Re: [sqlite] NULL representation/empty value in query results?

2005-03-23 Thread Dan Kennedy
What you have written below seems correct to me. If you're thinking of modifying source files to add the capability to the tcl interface, this is what I think: * You won't need to modify anything other than the "tclsqlite.c" file. Don't add a pragma. Instead add a tcl command to set the "null

Re: [sqlite] NULL representation/empty value in query results?

2005-03-23 Thread D. Richard Hipp
On Wed, 2005-03-23 at 20:49 +0100, Stefan Finzel wrote: > Although Tcl does not know NULL at all, sqlite does. Correct. The TCL bindings map NULLs into an empty string. -- D. Richard Hipp <[EMAIL PROTECTED]>

Re: [sqlite] NULL representation/empty value in query results?

2005-03-23 Thread Stefan Finzel
Although Tcl does not know NULL at all, sqlite does. From my current unterstanding there are five different fundamental internal datatypes. One of them is SQLITE_NULL. But SQLITE_NULL is not used at all while iterating over the results of dbcmd eval "SELECT ..." From my current unterstanding

Re: [sqlite] NULL representation/empty value in query results?

2005-03-23 Thread Kurt Welgehausen
> Yeah! I've missed the default option. But is this SQL standard? Yes. > sqlite> insert into deftest (i, s) values (NULL,''); This inserts NULL (not a string) into i and '' into s. When you retrieve that row using tcl, both are represented by empty strings. Default values replace missing

Re: [sqlite] NULL representation/empty value in query results?

2005-03-23 Thread Dennis Cote
Stefan Finzel wrote: Within sqlite console there is a a command .nullvalue NULL All I want is to know how I can set and use this mechanismen from my Tcl interpreter too. The shell can do this because it is implemented in C, which can distinguish between the NULL and empty string return values

Re: [sqlite] NULL representation/empty value in query results?

2005-03-23 Thread Stefan Finzel
Hello Jay, Yes, that is the expected behaviour. But that is not my problem. Within sqlite console there is a a command .nullvalue NULL All I want is to know how I can set and use this mechanismen from my Tcl interpreter too. Of cause it would be possible to misuse the default setting to get the

Re: [sqlite] NULL representation/empty value in query results?

2005-03-23 Thread Jay
--- Stefan Finzel <[EMAIL PROTECTED]> wrote: > Yeah! I've missed the default option. But is this SQL standard? > > And it does not seem to work for me at all. I still can't differ > empty and NULL; > create table deftest (k integer primary key, > i integer default

Re: [sqlite] NULL representation/empty value in query results?

2005-03-23 Thread Stefan Finzel
Yeah! I've missed the default option. But is this SQL standard? And it does not seem to work for me at all. I still can't differ empty and NULL; create table deftest (k integer primary key, i integer default 'NULL', s char default 'NULL'); sqlite> insert

Re: [sqlite] NULL representation/empty value in query results?

2005-03-23 Thread Kurt Welgehausen
> Is there a way to change the NULL representation ... ? No. Tcl has no null value. Usually this is not a problem, but if you really need to distinguish between a missing value and an empty string, you can use default values. sqlite> create table deftest (k integer primary key, ...>

[sqlite] NULL representation/empty value in query results?

2005-03-23 Thread Stefan Finzel
Hi, maybe this is also a too simple question but I miss it "once again? ;-) " I am using tclsqlite 2.8.16/3.1.x/3.2.0 to query for results containing NULL and/or empty integer/float/text/blob. Is there a way to change the NULL representation to get a specified string (NULL, NAN) for NULL values