SQLite Data-Types

Bill Norris

Active Member
Licensed User
Longtime User
I am creating a database table in Access and exporting to csv. When importing that csv into SQLite, there is no functionality to recognize and assign data-types of the fields, so one must use an SQLite editor to open the database and define the data-types for the fields -- no problem, easy enough. I was reading, though, the SQLite is "typeless" when it comes to what types of data can be stored in what fields -- cool, I thought. So, I tried to work with the database in b4e without setting the data-types. Didn't go as hoped. It appear that whenever I tried to use the Cursor.GetInt function on a field that was not specifically set as a numeric field, an error was generated. Likewise with Cursor.GetString, etc. It would be great to not have to go into an SQLite editor and redefine the data-types every time I re-import an updated csv file. Anybody have any thoughts on this?
 

Mahares

Expert
Licensed User
Longtime User
Bill: You cannot leave the data type in a SQLite table blank. It must be one of the following: INTEGER, TEXT, REAL, OR BLOB.
 
Upvote 0
Top