Subject Re: Listing current generator values, execute statement
Author Alexander V.Nevsky
--- In, Bob Murdoch <ram5@e...>
> execute statement 'select gen_id(' || generator_name || ',0)
> rdb$database'
> into :current_value;
> The error is:
> Variable type (position 0) in Execute Statement 'select
> gen_id(batch_nbr_gen ,0) f' does not match return.
> I'm assuming that the value returned from gen_id is not an integer?

No, EXECUTE STATEMENT don't make type conversions and don't know
what the type is returned by gen_id. Use explicit Cast:

execute statement 'select Cast(gen_id(' || generator_name || ',0) as
Integer) from rdb$database'

Best regards,