Re: [sqlite] .import NULL

2008-01-23 Thread Robert Wishlaw
On Jan 23, 2008 7:54 AM, Dennis Cote <[EMAIL PROTECTED]> wrote: > Robert Wishlaw wrote: > > When .import parses an empty field in the csv file, that is , a comma > > immediately followed by another comma, is the cell, in the database, > > that corresponds to the empty field a NULL cell? > > >

Re: [sqlite] .import NULL

2008-01-23 Thread Dennis Cote
Robert Wishlaw wrote: When .import parses an empty field in the csv file, that is , a comma immediately followed by another comma, is the cell, in the database, that corresponds to the empty field a NULL cell? Robert, No, it inserts a text field containing an empty string. All the fields

[sqlite] .import NULL

2008-01-22 Thread Robert Wishlaw
Using sqlite3 3.5.4 I have created a SQLite database and loaded it from a csv file using the sqlite .import statement with a comma separator. When .import parses an empty field in the csv file, that is , a comma immediately followed by another comma, is the cell, in the database, that corresponds

Re: [sqlite] .import null values

2005-10-25 Thread Kurt Welgehausen
> Affinity Modes ... how do you activate these? I don't believe strict affinity has been implemented; someone correct me if that's not right. Regards

Re: [sqlite] .import null values

2005-10-25 Thread David Finlayson
It sounds like you loose some of the economy of sqlite by needing a more sophisticated front-end coded up to drive it (for example, to do type checking)... At any rate, my needs aren't too complicated. I was looking for a portable replacement for MS Access to hold my research results (long time

Re: [sqlite] .import null values

2005-10-25 Thread Dennis Cote
David Finlayson wrote: Thanks for the link . In section 6 of this page there is mention of Affinity Modes, how do you activate these? See section 2.1 of that page. As it is now you can get completely irrational behavior with mathematical operators:

Re: [sqlite] .import null values

2005-10-25 Thread David Finlayson
Thanks for the link . In section 6 of this page there is mention of Affinity Modes, how do you activate these? As it is now you can get completely irrational behavior with mathematical operators: sqlite> create table temp (a INTEGER); sqlite> insert into

Re: [sqlite] .import null values

2005-10-25 Thread Brass Tilde
> >sqlite> create table t (a, b integer, c real); > this is a great explanation, but, why does 1,2,3 return as > text,integer,integer and not integer,integer,integer? I suspect that it's because no type was specified for field 'a', so everything is interpreted as text. Brad

Re: [sqlite] .import null values

2005-10-25 Thread Puneet Kishor
On Oct 25, 2005, at 10:02 AM, Dennis Cote wrote: .. The following shows what happens when some sample data is imported into tables with different column types (note the spaces after the commas in the last three rows). 1,2,3 3.14,1.414,2.718 5+6,7-8,9*9 1, 2, 3 3.14, 1.414, 2.718 5+6, 7-8,

Re: [sqlite] .import null values

2005-10-25 Thread Dennis Cote
David Finlayson wrote: OK, I can deal with the Nulls that in SQL...now, what do you mean that "even numeric data" is imported as text? I loaded about 85k records into a database, all numeric, and didn't notice any problems using max() or stdev(). Should I be concerned about something?

Re: [sqlite] .import null values

2005-10-25 Thread Kurt Welgehausen
> "even numeric data" is imported as text Column types in Sqlite are not strictly enforced. If you import data that 'look' numeric from your text file into a column with a numeric type, the data will be stored in a numeric format; if a particular value cannot be converted to a numeric format, it

Re: [sqlite] .import null values

2005-10-25 Thread David Finlayson
On 10/24/05, Dennis Cote <[EMAIL PROTECTED]> wrote: > The .import command in sqlite always imports data as text (even numeric > data into numeric columns). There is no way to import a NULL value. The > closest you can get is an empty string or some other sentinel value, > like the string NULL

Re: [sqlite] .import null values

2005-10-24 Thread Dennis Cote
David Finlayson wrote: I'm new to sqlite3 and couldn't find any documentation on the .import command, so a pointer to the docs may be all that's needed. Sorry if this is simple... My problem is that I have been trying to .import null values from a delimited text file (colon is delimiter) with

Re: [sqlite] .import null values

2005-10-22 Thread David Finlayson
This works of course (and I hadn't thought of it, honestly) but on wide tables (lots of columns) UPDATE isn't fun to type. David On 10/22/05, Kurt Welgehausen <[EMAIL PROTECTED]> wrote: > If you want all the empty fields to be null, why not > just set them, with a single sql statement (per >

Re: [sqlite] .import null values

2005-10-22 Thread Kurt Welgehausen
If you want all the empty fields to be null, why not just set them, with a single sql statement (per affected column), after the import? Regards

[sqlite] .import null values

2005-10-22 Thread David Finlayson
I'm new to sqlite3 and couldn't find any documentation on the .import command, so a pointer to the docs may be all that's needed. Sorry if this is simple... My problem is that I have been trying to .import null values from a delimited text file (colon is delimiter) with no success. Here is an