List:General Discussion« Previous MessageNext Message »
From:Bernd Tannenbaum Date:October 21 2003 11:40am
Subject:Re: export to textfile
View as plain text  
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.
Thread
export to textfileBernd Tannenbaum21 Oct
  • Re: export to textfileRory McKinley21 Oct
    • Re: export to textfileBernd Tannenbaum21 Oct
  • Re: export to textfileVictoria Reznichenko21 Oct
  • Re: export to textfileRory McKinley21 Oct
    • Re: export to textfile -solved :)Bernd Tannenbaum21 Oct
      • Moving to Linux and NetAppsBarry Cornelius21 Oct
Re: export to textfileAlec.Cawley21 Oct