Subject Re: Listing current generator values, execute statement
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, Bob Murdoch <ram5@e...>
wrote:
> execute statement 'select gen_id(' || generator_name || ',0)
from
> 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,
Alexander