Subject Re: [firebird-support] NULL confusion, again
Author t.s.
>> Since the tables are empty, the result of the variable TOTAL is always
>> 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.
Thank you all for the answers.
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.