Subject Re: RES: RES: [firebird-support] Null and parameters
Author Christian Danner
Hi Adam,

on Sat, 07 Jan 2006 23:44:34 -0000, you wrote:

>> Shouldn't either 'execute statement' or a sp be used, but not
>> necessarily both.
>You will have a fun time trying to use execute statement without a
>stored procedure (or trigger) considering it is part of the PSQL
>language rather than SQL.

Sure. Nevertheless you don't need both ;-)

>> Within a sp the originally discussed syntax does work, no problematic
>> client side replacement of the variable.
>Have you tested this?

For me - within sps - select statements with where clauses including
(:var is null)
or (field = :var)
work great for years.

But why not generally permit the expression 'null is null' as a
comparison, when '1 is null' (e.g. in a 'select case' statement) is
allowed and interpreted as 'false'. Shouldn't 'Unknown is Unknown' be
a legitimate question and answered with 'true'?

>If so I wouldn't regard it as future proof
>behaviour because parameters are substitutable values not a random
>string to be inserted at runtime.

Shouldn't we differentiate between named parameters as a client side
feature, translated into the positional XSQLVAR fields in order to do
the api call, and (named) parameters/variables within sps, which might
be wholly different things in further interpretation and processing -

>You may find a future version breaks
>this behaviour.

Now you rattled me.