Subject Re: [ib-support] SQL Scripting
Author Helen Borrie
At 02:18 PM 8/06/2003 +1000, you wrote:
>Im trying to write some sql script (not inside a procedure or trigger) to
>modify some data in my tables using variables to temporarily store data and
>use it a little further on in the script. This is an example of what i have
>at the moment:
>
>declare variable MaxValue integer;
>
>which from what i have read of the documentation is correct syntax

-- but not in scripts! You can declare variables in stored procedures and
triggers, but not in scripts, which are just batches of SQL statements.

And you can't use stored procedures to perform DML.

> but when
>i run it I get the following error:
>
>Dynamic SQL Error
>SQL error code = -104
>Token unknown - line 1, char 9
>variable
>Statement: declare variable MaxValue int

Yup. It's just the parser telling you it doesn't know about a DSQL keyword
"VARIABLE".

heLen