Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unloading data from script in Mysql 1

Status
Not open for further replies.

carlg

Programmer
Jun 23, 2004
88
US
In Inofmrix database, I would do the following in my script

dbaccess custdb << !
unload to myfile.unl
select * from mytable
!


and the myfile.unl would have the data in a pipe delimited format.


How do I do this with mysql??

Thanks for the info.

Carl

 
You could use something like:
[tt]
SELECT *
INTO OUTFILE '/tmp/myfile.unl' FIELDS TERMINATED BY '|'
FROM mytable
[/tt]
There are many other file-format options; these are explained in the manual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top