Subject Re: [firebird-support] NULL confusion, again
Author Dimitry Sibiryakov
On 20 Apr 2006 at 8:25, t.s. wrote:

>Again, if i understood Ms Helen Borrie's message correctly, if the
>select returns NULL, the variable total will not be affected, so it
>will be still be zero.

Not so. The variable will not be affected if select returns no
records.

>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.

--
SY, Dimitry Sibiryakov.