Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: csv2sql.pl

by davidrw (Prior)
on Oct 20, 2006 at 12:25 UTC ( [id://579562]=note: print w/replies, xml ) Need Help??


in reply to csv2sql.pl

Some thoughts on various modules to do some/all of the work for you:

Could use DBD::CSV to read the source tables .. or use something like DBIx::Copy with it to do everything in one shot.

For the just-generate-the-sql method, SQL::Abstract is a handy module ..

It might also be possible w/DBD::AnyData to do it with a single cross-db SQL statement (not sure if they both need to by in-memory tables or not):
INSERT INTO db_table ( col1, col2, col3 ) SELECT colA, colB, colC FROM csv_table ;

Replies are listed 'Best First'.
Re^2: csv2sql.pl
by ciderpunx (Vicar) on Oct 20, 2006 at 13:11 UTC
    Thanks for taking the time to look at my code and suggest other ways to do it - much appreciated. It sounds like I could definitely make some improvements - I'll post in this node if I get round to it.

    Cheers

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://579562]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found