erlang-sqlite3
erlang-sqlite3 copied to clipboard
Where col = null
Hello
Sqlite3 expects the following syntax when when checking for NULL:
SELECT 1 FROM items WHERE col is NULL;
The query where "col = NULL" ( with equal sign ) is used, returns no records.
Hello,
Do we have query like that somewhere, or are you asking about adding code that will replace queries like this with is null
?
For example:
sqlite3_lib:read_sql(Tbl, Key, Value) -> ["SELECT * FROM ", to_iolist(Tbl), " WHERE ", to_iolist(Key), " = ", value_to_sql(Value), ";"].
if Value is null, an equal sign will be used in SQL query, when it seems sqlite3 expects "is" operator.
Ok, i see. Those functions are just for convenience, we expect that for more complex stuff you will need to use sql directly, but i may be able to add handling for this case.