How can we stock the query result into a text file
How can we stock the query result into a text file
am 25.06.2009 16:18:14 von Lin Chun
--001485f45052015607046d2ce516
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi
In mysql , how can we stock the query result into a text file
the table is too large , i don't want to dump it , but select a part of it,
i wrote a script perl to do this, but each time i have to change the
parameters in the script to get another table, when i google it, i find the
function in Oracle
"
spool 'filenameandpath.txt'
select ...
from ..
/
spool off
"
does Mysql has such function?
--
-------------------------
Lin Chun
--001485f45052015607046d2ce516--
Re: How can we stock the query result into a text file
am 25.06.2009 16:29:39 von John Daisley
SELECT INTO OUTFILE does almost the same thing as spool in SQL*Plus
SELECT columnname from tablename into outfile '/path/and/filename.txt'
Regards
John
> Hi
>
> In mysql , how can we stock the query result into a text file
>
> the table is too large , i don't want to dump it , but select a part of
> it,
> i wrote a script perl to do this, but each time i have to change the
> parameters in the script to get another table, when i google it, i find
> the
> function in Oracle
>
> "
> spool 'filenameandpath.txt'
>
> select ...
> from ..
> /
>
> spool off
> "
> does Mysql has such function?
>
>
>
>
> --
> -------------------------
> Lin Chun
>
>
> ______________________________________________
> This email has been scanned by Netintelligence
> http://www.netintelligence.com/email
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: How can we stock the query result into a text file
am 26.06.2009 10:13:26 von yueliangdao0608
--0016e646071035f1d7046d3bea70
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Login mysql client. Do the following commands.
tee ie.txt;
....
notee;
On Thu, Jun 25, 2009 at 10:29 PM, John Daisley <
john.daisley@mypostoffice.co.uk> wrote:
> SELECT INTO OUTFILE does almost the same thing as spool in SQL*Plus
>
> SELECT columnname from tablename into outfile '/path/and/filename.txt'
>
> Regards
>
> John
>
>
> > Hi
> >
> > In mysql , how can we stock the query result into a text file
> >
> > the table is too large , i don't want to dump it , but select a part of
> > it,
> > i wrote a script perl to do this, but each time i have to change the
> > parameters in the script to get another table, when i google it, i find
> > the
> > function in Oracle
> >
> > "
> > spool 'filenameandpath.txt'
> >
> > select ...
> > from ..
> > /
> >
> > spool off
> > "
> > does Mysql has such function?
> >
> >
> >
> >
> > --
> > -------------------------
> > Lin Chun
> >
> >
> > ______________________________________________
> > This email has been scanned by Netintelligence
> > http://www.netintelligence.com/email
> >
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=yueliangdao0608@gmail.com
>
>
--
David Yeung,
MySQL Senior Support Engineer,
Sun Gold Partner.
My Blog:http://yueliangdao0608.cublog.cn
--0016e646071035f1d7046d3bea70--
Re: How can we stock the query result into a text file
am 26.06.2009 11:43:09 von Johan De Meersman
--001636c5b9e80597ee046d3d2b5b
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Have a look at "create table as select" and the csv engine.
On Thu, Jun 25, 2009 at 4:18 PM, Lin Chun wrote:
> Hi
>
> In mysql , how can we stock the query result into a text file
>
> the table is too large , i don't want to dump it , but select a part of it,
> i wrote a script perl to do this, but each time i have to change the
> parameters in the script to get another table, when i google it, i find the
> function in Oracle
>
> "
> spool 'filenameandpath.txt'
>
> select ...
> from ..
> /
>
> spool off
> "
> does Mysql has such function?
>
>
>
>
> --
> -------------------------
> Lin Chun
>
--
Celsius is based on water temperature.
Fahrenheit is based on alcohol temperature.
Ergo, Fahrenheit is better than Celsius. QED.
--001636c5b9e80597ee046d3d2b5b--
RE: How can we stock the query result into a text file
am 26.06.2009 16:43:17 von Jerry Schwartz
>-----Original Message-----
>From: Moon's Father [mailto:yueliangdao0608@gmail.com]
>Sent: Friday, June 26, 2009 4:13 AM
>To: john.daisley@butterflysystems.co.uk
>Cc: Lin Chun; mysql@lists.mysql.com
>Subject: Re: How can we stock the query result into a text file
>
>Login mysql client. Do the following commands.
>tee ie.txt;
>...
>notee;
>
[JS] A more useful way is to redirect the output of the MySQL CLI into a
file. That will give you a tab-delimited file:
>mysql .... < query.sql > queryoutput.txt
Regards,
Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
www.the-infoshop.com
>On Thu, Jun 25, 2009 at 10:29 PM, John Daisley <
>john.daisley@mypostoffice.co.uk> wrote:
>
>> SELECT INTO OUTFILE does almost the same thing as spool in SQL*Plus
>>
>> SELECT columnname from tablename into outfile '/path/and/filename.txt'
>>
>> Regards
>>
>> John
>>
>>
>> > Hi
>> >
>> > In mysql , how can we stock the query result into a text file
>> >
>> > the table is too large , i don't want to dump it , but select a part
>of
>> > it,
>> > i wrote a script perl to do this, but each time i have to change the
>> > parameters in the script to get another table, when i google it, i
>find
>> > the
>> > function in Oracle
>> >
>> > "
>> > spool 'filenameandpath.txt'
>> >
>> > select ...
>> > from ..
>> > /
>> >
>> > spool off
>> > "
>> > does Mysql has such function?
>> >
>> >
>> >
>> >
>> > --
>> > -------------------------
>> > Lin Chun
>> >
>> >
>> > ______________________________________________
>> > This email has been scanned by Netintelligence
>> > http://www.netintelligence.com/email
>> >
>>
>>
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:
>> http://lists.mysql.com/mysql?unsub=yueliangdao0608@gmail.com
>>
>>
>
>
>--
>David Yeung,
>MySQL Senior Support Engineer,
>Sun Gold Partner.
>My Blog:http://yueliangdao0608.cublog.cn
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org