[sqlite] .import command/NULL values

2016-03-16 Thread R Smith
On 2016/03/16 11:53 AM, Bernard McNeill wrote: > Any particular reason why the shell '.import' command cannot interpret || > as a NULL for the field? The reason the import mechanism doesn't cope with NULLs is not because it can't, but because it shouldn't - until the TEXT standard changes in t

[sqlite] .import command/NULL values

2016-03-16 Thread Clemens Ladisch
Bernard McNeill wrote: > Any particular reason why the shell '.import' command cannot interpret || > as a NULL for the field? > Does || have another use/interpretation? Everything is a string. The data between the two separators is an empty string. Regards, Clemens

[sqlite] .import command/NULL values

2016-03-16 Thread Clemens Ladisch
Bernard McNeill wrote: > If it is required to import NULL values into an Sqlite table field, can > this be done No; the .import commands imports everything as text. (This can result in numbers in columns that have numeric affinity.) To get NULL values, UPDATE the table afterwards. Regards, Clem

[sqlite] .import command/NULL values

2016-03-16 Thread Bernard McNeill
Any particular reason why the shell '.import' command cannot interpret || as a NULL for the field? Does || have another use/interpretation? Just seems a shame that the standard bulk input mechanism cannot cope directly with NULLs. Best regards On Wed, Mar 16, 2016 at 9:13 AM, Simon Slavin wrote

[sqlite] .import command/NULL values

2016-03-16 Thread Simon Slavin
On 16 Mar 2016, at 9:02am, Simon Slavin wrote: > No. Use one of these two methods. I'm sorry. I read your 'import' but I thought you meant using INSERT. If you are using the shell's ".import" command then Clemens is right. You are importing from a text file, and there is no way to put a N

[sqlite] .import command/NULL values

2016-03-16 Thread Simon Slavin
On 16 Mar 2016, at 8:43am, Bernard McNeill wrote: > If it is required to import NULL values into an Sqlite table field, can > this be done simply by arranging that the before and after delimiters for > that field are consecutive? No. Use one of these two methods. CREATE TABLE t(a,b,c) It is

[sqlite] .import command/NULL values

2016-03-16 Thread Bernard McNeill
I couldn't find this issue documented anywhere. If it is required to import NULL values into an Sqlite table field, can this be done simply by arranging that the before and after delimiters for that field are consecutive? Example: For a three field table (all three fields text type), importing fr