On 3/19/08, Derek Developer <[EMAIL PROTECTED]> wrote:
> In SQLite a NUL is nothing. Inserting a NUL into a column defined as Integer 
> for example creates a zero length entry not an Integer of value zero.
>
>  How do traditional databases with static typing deal with this?

Probably all differently. Please, if you do research, do summarize
your findings and post them here as well as on the SQLite wiki. Maybe
someone has already done that.

>  Do they check the column delaration and convert the NUL to a zero value upon 
> entry?
>
>  How does SQLite handle sorting with a column that contains values (including 
> zero) and NULs? Are the NULs converted to zero for the purposes of sorting?
>
>

[12:35 AM] ~$ sqlite3
SQLite version 3.5.6
Enter ".help" for instructions
sqlite> create table a (b integer);
sqlite> insert into a (b) values (1);
sqlite> insert into a (b) values ('2');
sqlite> insert into a (b) values (NULL);
sqlite> insert into a (b) values ('');
sqlite> select count(*) from a;
4
sqlite> select rowid, * from a;
1|1
2|2
3|
4|
sqlite> select rowid, * from a order by b desc;
4|
2|2
1|1
3|
sqlite> select rowid, * from a order by b asc;
3|
1|1
2|2
4|
sqlite>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to