
July 9th, 2004, 01:30 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
Depends on where you want the file exported. Say that you want the file exported to the same machine that mysql is running on, MySQL has a SELECT * INTO OUTFILE syntax.
Code:
SELECT field1, field2, field3
INTO OUTFILE '/tmp/file.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM tablename;
See http://dev.mysql.com/doc/mysql/en/SELECT.html for more.
If you want the file to be exported into a client machine (and mysql is running on a separate server), then you might want to use Delphi to open a database connection and retrieve the data. Then, you can use regular Delphi file functions (or TStringList or even the ADO components) to write out a CSV file.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
|