table.
Matt
--- On Wed, 17/8/11, Stephan Beal wrote:
From: Stephan Beal
Subject: Re: [sqlite] null handling import
To: "General Discussion of SQLite Database"
Date: Wednesday, 17 August, 2011, 18:13
On Wed, Aug 17, 2011 at 7:12 PM, matthew (matthew.jsoft) white <
matthew.js
On Wed, Aug 17, 2011 at 7:12 PM, matthew (matthew.jsoft) white <
matthew.js...@btinternet.com> wrote:
> I didn't realise that views could be written to.
>
i didn't, either. Thank you very much for posting a follow-up with your
results. i now have some experimentation to do...
Happy Hacking!
--
dable form which allows them to be easy visually scanned and DIFF'ed
when testing the AWK conversion programs.
I didn't realise that views could be written to.
Cheers,
Matt
--- On Sun, 14/8/11, BareFeetWare wrote:
From: BareFeetWare
Subject: Re: [sqlite] null handling import
To: &quo
Mattew,
> Obviously I am not as well versed in sqlite as you are. I hate to
> hate myself, but am still continuing with reading somewhat ancient
> files into a somewhat cohorrent database.
>
>Thanking you for your time and trouble,
>
> Matthew
>
>p.s. shame about the parsing of comma delim
Oops, I forgot the "new." prefixes. That trigger should be:
create trigger "Import insert"
instead of insert
on Import
begin
insert into Person (Name, Email)
select
case when new.Name = '' then null else new.Name end
, case when new.Email = '' then null else new.Email end
;
end
;
Or more simply
> On 13 Aug 2011, at 7:58am, matthew (matthew.jsoft) white wrote:
>
>> I was just wondering if sq3 has some kind of mechanism to parse blank
>> records as null instead of empty strings.
One way to do this is to import into a view and use a trigger to convert the
rows how you like.
For example:
On 13 Aug 2011, at 9:58pm, matthew (matthew.jsoft) white wrote:
> Thanking you for your time and trouble,
Don't worry, giving advice like that is exactly what this list is for.
Everyone has to learn sometime and even SQLite is so complicated you can't pick
it all up at once. Good luck with t
though. Goodnight.
--- On Sat, 13/8/11, Simon Slavin wrote:
From: Simon Slavin
Subject: Re: [sqlite] null handling import
To: "General Discussion of SQLite Database"
Date: Saturday, 13 August, 2011, 19:46
On 13 Aug 2011, at 7:05pm, matthew (matthew.jsoft) white wrote:
> Didn
On 13 Aug 2011, at 7:05pm, matthew (matthew.jsoft) white wrote:
> Didn't know about the "typeoff" function. Is this anything like the CAST sql
> syntax or is it peculiar to sqlite?
One of SQLite's built in functions:
http://www.sqlite.org/lang_corefunc.html
Simon.
___
ly meld some dubious text file
formats from differing countries into some sort of a unified database.
Thanking you for the clarification regarding the treatment of empty strings in
sqlite,
Matthew
--- On Sat, 13/8/11, Simon Slavin wrote:
From: Simon Slavin
Subject: Re: [sqlite] null handling
On 13 Aug 2011, at 4:50pm, matthew (matthew.jsoft) white wrote:
> I'm not too clear about your answer. Could you please elaborate?
>
> Your response about zero length strings certainly helps with my understanding
> of the output of select statements, in that when you see a blank field it is
>
keyboards which is
never used. This makes it clear to me that a field is definitely null as
opposed to a zero length string.
Sincerly,
Matthew
--- On Sat, 13/8/11, Simon Slavin wrote:
From: Simon Slavin
Subject: Re: [sqlite] null handling import
To: "General Discussion of SQLite Databa
On 13 Aug 2011, at 7:58am, matthew (matthew.jsoft) white wrote:
> I've modified all scripts which replaces empty strings with 'null' , and
> every things hunky dory. I was just wondering if sq3 has some kind of
> mechanism to parse blank records as null instead of empty strings.
Probably not,
lued logic, but was
trying to clarify whether or not dot_importing supports NULLs at all?
Sincerely,
Matthew
n Sat, 13/8/11, H. Phil Duby wrote:
From: H. Phil Duby
Subject: Re: [sqlite] null handling import
To: "General Discussion of SQLite Database"
Date: Saturday, 13 August
On Fri, Aug 12, 2011 at 14:59, matthew (matthew.jsoft) white
wrote:
>
> This may seem obvious for seasoned users, but sqlite3 always turns every
> blank input token into an empty string.
>
> For example, say you are dot.importing a colon separated file such as :-
>
> create table foo ( col1 integ
This may seem obvious for seasoned users, but sqlite3 always turns every blank
input token into an empty string.
For example, say you are dot.importing a colon separated file such as :-
create table foo ( col1 integer, col2 varchar(100) );
.separator ":"
1001:'a_string' -- dynamic string
16 matches
Mail list logo