Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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'

Cheers

Harold

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://927807]
help
Chatterbox?
marto was working yesterday
[Corion]: marto: Ow :(
[marto]: Corion, not to worry, it was ok :)
[Corion]: I "just" had a call from a friend whom I host the website for, and they were quite hectic yet uninformed about what they'd have to change for GDPR... This felt like work to me, but at least I got that call in a café, not in the office
[Corion]: But hopefully today I'll be a bit calmer and call them and update their website with what little they need to change for GDPR. Having a "business front page" as website means you collect and handle very little PII ;)
[marto]: I've yet to do my mandatory training, GDPR is purely focused at businesses?
[marto]: there's just so much FUD
[choroba]: we had the training yesterday
[hippo]: GDPR applies to everyone but there is an exception for individuals keeping records of their own personal activities.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2018-05-22 07:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?