Subject Re: [firebird-support] null stored procedure?
Author Helen Borrie
At 10:15 AM 20/06/2004 +0000, you wrote:
>Hi all,
>This is probably obvious but what is wrong with this stored
>procedure? I
>get the error invalid character ":" Can I not do this?
>
>begin
> if (:suptype is null) then
> begin

Yup: the colon is illegal here.

> :suptype = 'type';
> end

The rule about the colon is: it is required in SQL statements; otherwise
it's illegal. Although the reason for the rule might seem a bit obscure,
it's simple: it's possible to have variables (local, input args, output
args) that have the same names as columns from tables. Therefore, whenever
you involve a variable in an SQL statement, you mark it with a colon. When
you use it in a PSQL statement, no colon.

/heLen