Subject | Re: [firebird-support] Re: Why NULL <> NULL ? |
---|---|
Author | Paul Vinkenoog |
Post date | 2006-05-18T14:22:38Z |
Hi jasajona,
Are you absolutely sure it returns false (or null)?
If so, please let us now your exact Firebird version (number, Classic
or Superserver, OS) and the complete SQL context (that is, the entire
if... then... begin... end code).
And this _should_ return null if one or both fields are null.
As I said, look at the Null guide.
And as others said, use COALESCE. (Its use is described in the Null
guide too).
Greetings,
Paul Vinkenoog
>> If you want to compare for the state as well, you haveIt should resolve to (true or null), which in turn resolves to true.
>> to modify your code OR use the COALESCE function
>
> if (field1 is null or field1 = field2) then ...
> this statement always returs false even if field1 = null :(
Are you absolutely sure it returns false (or null)?
If so, please let us now your exact Firebird version (number, Classic
or Superserver, OS) and the complete SQL context (that is, the entire
if... then... begin... end code).
> even this returns always false:I think you meant: if not( field1 <> field2 ) then...
> if (not field1 <> field2) then ...
And this _should_ return null if one or both fields are null.
As I said, look at the Null guide.
And as others said, use COALESCE. (Its use is described in the Null
guide too).
Greetings,
Paul Vinkenoog