Baruch Burstein wrote:
> "SELECT col1 FROM table1 WHERE col2=:val"
>
> col2 is a textual string, and may sometimes be NULL. If I bind a string to
> :val it works fine. If I bind a null-pointer the comparison fails since it
> should be using ISNULL. Is there a way to do this correctly with a single
> statement?

In SQLite, IS works correctly with non-NULL values:

  SELECT col1 FROM table1 WHERE col2 IS :val

However, this would not use an index.  Better use two SQL statements.


And shouldn't the value in the database be an emptry string instead?


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to