Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: dynamic bulk insert in sqlite

by erix (Vicar)
on Sep 22, 2012 at 08:29 UTC ( #995080=note: print w/ replies, xml ) Need Help??


in reply to dynamic bulk insert in sqlite

Assuming there is a header line: just chop off the first line (the header line) and split that into an array. With that array, build a create table statement (it's often necessary to sanitize the column names), and send it to SQLite. After that, just send the whole file *except* the first line.

If there is no headerline, generating the column-names + create table statement is obviously even easier.

(The whole procedure is not SQLite specific either, the bulk loader used will differ per DBMS)


Comment on Re: dynamic bulk insert in sqlite

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (17)
As of 2014-08-27 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (238 votes), past polls