4 ms·
I can think of a badly designed database interface. All SQL databases handle NULL as a special value, that cannot be compared by equality. But if you want compa
by maze-le 9y ago
I can think of a badly designed database interface. All SQL databases handle NULL as a special value, that cannot be compared by equality. But if you want compare the return value of a sql prompt in some language you can make a fallacy like:
sqlstring = "SELECT 1 = NULL;"
returnValue = callDB(sqlstring)
if returnValue == "NULL"
// here you go...
end
A solution would be to let the database handle NULL-values:
sqlstring = "SELECT 1 IS NULL;"