Subject | Re: [firebird-support] NULL confusion, again |
---|---|
Author | t.s. |
Post date | 2006-04-21T04:14:45Z |
>> Since the tables are empty, the result of the variable TOTAL is alwaysThank you all for the answers.
>> NULL inside this stored procedure (Firebird 1.5.3, Win32). This kinda
>> contradicts my conclusion above (about how a SELECT INTO that returns
>> a NULL will not affect the variable value).
> In this case you use SUM(). Aggregate queries like this _always_
> return at least one record. Your query returned one record with NULL
> value and thus the variable was changed.
I was trying to establish a standard, 'idiomatic' way to do this, and
it seems that the only 'bulletproof' way is to use coalesce() on
everything.
*Going off to memorize the Firebird NULL Guide*.
Regards,
t.s.