Subject Re: [firebird-support] Set generator in execute block
Author Thomas Steinmaurer
> When trying to execute the following it produces an error:
>
> SET TERM ^ ;
>
> EXECUTE BLOCK
> AS
> DECLARE VARIABLE vMaxID BIGINT;
> BEGIN
> SELECT MAX(ID) FROM A_TABLE
> INTO :vMaxID;
>
> SET GENERATOR GEN_A_TABLE_ID TO :vMaxID;
> END
>
> SET TERM ; ^
>
> the error being
>
> Engine Code : 335544569
> Engine Message :
> Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 10, column 3
> SET

This is expected for DDL statements in PSQL.

> I have tried wrapping it in an EXECUTE STATEMENT block to the same effect.

This should work. What error message do you get here?

--
With regards,
Thomas Steinmaurer (^TS^)
Firebird Technology Evangelist

http://www.upscene.com/
http://www.firebirdsql.org/en/firebird-foundation/