Hi Bernd

Will the query be static? E.g. could you put the SELECT ..INTO OUTFILE query
into a batch file and just call that batch file from the command line?

mysql -u user -p < arb_file.bat

Obviously this will be a little more of a problem if you generate the query
dynamically each time.

Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
"There are 10 kinds of people in this world,
those who understand binary and those who don't" (Unknown)
----- Original Message ----- 
From: "Bernd Tannenbaum" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 21, 2003 1:40 PM
Subject: Re: export to textfile


Hello....and ty for the fast answers, but....

Am Dienstag, 21. Oktober 2003 13:10 schrieben Sie:
> Hi Bernd
> If you are just interested in dumping the data in CSV (or whatever) format
> you can do it like so:
> SELECT *
> INTO OUTFILE 'arb_file.csv' FIELDS TERMINATED BY ',' LINE TERMINATED BY
> '\n' FROM  arb_table
> WHERE arb_conditions

Well, my problem is i need to export from a script (currently bash-script in
Linux) so im looking for the options to give with "mysql -e".
What u wrote in ur mail, i found too. But how do i give the "FIELDS
TERMINATED
BY" option in the command line of a script.

Example for import (working fine):
./mysqlimport --local --fields-terminated-by=';'
--columns=record_type,...[...] dbname /PATH/file --password=xxx

Now the export (not working)
./mysql FIELDS TEMINATED BY ';' --skip-column-names -e "select
ek_satzart,[...] from table" dbname > /PATH/file --password=xxxx

See, me wants to add options like "Fields terminated by" or other stuff to
the
command-line-export and i cannot find an explanation of Synatx here. In ur
example u just export from within the db which is explained fine in the
dokumentation but not what i need....

Hope i made the problem more clear now.
Ty,
Bernd








-- 

One OS to rule them all, one OS to find them.
One OS to bring them all, and in the darkness bind them
In the land of Redmond, where the shadows lie.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to