Subject | Re: [firebird-support] Why NULL <> NULL ? |
---|---|
Author | Martijn Tonies |
Post date | 2006-05-18T13:44:18Z |
>Not illogical at all.
>In trigger I have:
>--
>if (field1 = field1) then ...
>--
>when field1 = null, field2 = null
>
>(field1 = field2) = false :(
>
>so I have to make an exception for null case, that is very ilogical.
NULL it a state, not a value.
A column can have two states: NULL or NOT NULL
A column can have many values.
This is why in order to check the column state, you use
"IS NULL" or "IS NOT NULL", while when comparing
column values, you use "= <some other value>".
If you want to compare for the state as well, you have
to modify your code OR use the COALESCE function
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com