TTTTT wrote:
>
> You can use the sqlite binary to import data from a CSV file - if you do it
> that way you have to make sure that your data fields in the SQLite database
> match exactly in order the data in the CSV file. That's been my experience.
> The other way is to do it programmatically (Java, C++, etc). The advantage
> of that is you have control over the data import. Though the sqlite binary
> does an excellent job of importing data, it might be better to use the
> latter option if you want more control over the data. It's not a difficult
> job to do.
>
>
> Could you please explain how does it go by doing other way-programmatically
> in c++?
> I have installed sqlite and then i have found somewhere information that i
> also need a sqlite++ wrapper to be able to use sqlite trought c++. so, i
> have installed both, but i dont dont know how to connect sqlite and sqlite++
> to each other, if i have to do it, at all.
> I'm really new to all this, but i have an asignment to copy datas from c++
> into sqlite and i dont know even how to start..
> If someone could just tell me in short steps what do i need, then i will
> find somehow solutions for  each step..
>
> Thank you very much!
>   
(1) Parse the CSV data into a two-dimensional array.
(2) Get the column headers from the first row.
(3) Scan through each column to see if its data can be converted to 
INTEGER or REAL.  Based on this, choose a type affinity for the column.
(4) From the information determined in steps (2) and (3), build and 
execute a CREATE TABLE statement.
(5) BEGIN TRANSACTION
(6) Build and execute an INSERT statement for each row in the table.
(7) COMMIT

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to