Hi Albert,
> in the csv; the field is defined like:
>
> 2010.03.31 16:01:24.284  For a datetime field.
>
> I would like to tell sqlite that this is in 
> YYYY.mm.dd hh:mm:ss.sss
>
> How can I define this in sqlite's program so it imports the datetime
> correctly?
>   
I have used the SQLite C extension csv which works very nicely. It is a 
virtual table implementation. It is found in the sources and then 
compiled. You load the extension and it reads a file in csv format as a 
table. I use it for messaging data files for up to 30 Mbyte. It works 
with wrappers that load extensions in particular the Virtual Text 
extension: SQLite Expert; and Spatialite has a very nice implementation 
of the Virtual Text Module. For work of this type; an import table 
stores and manipulates the data. After manipulation; copy the data to 
another table for use. In this case another column would allow to 
reformat it if the import failed.

Because .csv format is useful as an application interface, 
programmatically I tried the Tcllib csv2Matrix which also works well. 
The code is short to read a csv file into a matrix and insert the matrix 
data into an SQLite table. Other scripting languages offer csv processing.

I do not know if these methods introduce performance limits in regards 
to the size of the import file.

Both methods offer the user the opportunity to define the csv format.

- Gary Gabriel



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

Reply via email to