July 9th, 2004, 02:30 PM
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.
SELECT field1, field2, field3
INTO OUTFILE '/tmp/file.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
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