Subject Re: [firebird-support] trigger variables and colon prefix
Author Helen Borrie
At 12:13 AM 11/08/2006, you wrote:
>declare variable bc char(3);
>begin
> select orderappend from branches
> into :bc;
> if( substr( new.link, 1, 3) != :bc) then
> begin
>...
>
>declare variable bc char(3);
>begin
> select orderappend from branches
> into :bc;
> if( substr( new.link, 1, 3) != bc) then
> begin
>...
>
>Both compiles, but what is the difference, if any, between using a colon or
>not?

The colon is **required** when you refer to a local variable, input
argument or output argument in a DML statement (SELECT, INSERT,
UPDATE, DELETE and EXECUTE PROCEDURE); otherwise it is not. The
IF() statement isn't DML so the usage in the first example is
incorrect and will cause an exception in some versions.

./heLen