Subject Re: [firebird-support] Trigger variable in function parameter
Author Helen Borrie
At 08:26 PM 19/05/2006, you wrote:
>Why server accepts this statement:
>
>declare variable v numeric(18,2);
>...
>coalesce(v, 0)
>
>I forgot to write ":" by the variable and had a headace for half of a
>day. Where is the point of accepting variable in parameters without ":"?

coalesce(v,0) on its own is nothing so, when you complain, it's
useful to show how you actually use these things.

However, the rule is that, when a variable is being referred in PSQL
language, it's the same as referring to it in any programming
language. So, for example, had your usage above been an assignment
to a variable, it would be correct.

e.g.
...
declare v2 numeric(18,2);
...

v2 = coalesce(v,0);

But if you were using the variable in a DSQL statement, it should
except if you try to refer to it without the colon marker:

Wrong:
select coalesce(v,0) from rdb$database into v2;

Should be
select coalesce(:v,0) from rdb$database into :v2;

./heLen