Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: adding database values to csv file

by dHarry (Abbot)
on Sep 26, 2011 at 07:40 UTC ( #927807=note: print w/replies, xml ) Need Help??

in reply to adding database values to csv file

Most databases offer functionality to allow you to dump the contents in various formats. Maybe you can make use of those tools? They typically give good performance.

Depending on the database brand it might be possible to use a SQL statement to produce a csv formatted output file, e.g. something like (mySQL):

SELECT col1, col2, col3, ... FROM some_table INTO OUTFILE '/tmp/some_table.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://927807]
[choroba]: Hi Corion! Where have you been?
[Discipulus]: ah! holidays i hope..
Discipulus without Corion and with choroba in another timezone the monastery was silent.. I was silbing alone in the cloister

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2017-02-22 08:39 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (325 votes). Check out past polls.