Subject Re: FB-1.5.2 SP error in execute statement
Author intellekta
--- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov"
<SD@t...> wrote:
> On 8 Feb 2005 at 19:07, intellekta wrote:
>
> >can anybody tell me why this statement works
> >
> >SELECT GEN_ID(GEN_MYTABLE_ID, 1) AS NID FROM RDB$DATABASE INTO NEWID;
> >
> >but this not ?
> >
> >SQL = 'SELECT GEN_ID(GEN_MYTABLE_ID, 1) AS NID FROM RDB$DATABASE';
> >EXECUTE STATEMENT SQL INTO NEWID;
>
> Because SELECT perform typecast from BIGINT to INTEGER while
> EXECUTE STATEMENT doesn't do this.
> AFAIR it was done for better security.
> --
> SY, Dimitry Sibiryakov.
Thanks for your info.
This statement works fine.
SQL = 'SELECT CAST(GEN_ID(GEN_ALTBENUTZER_ID, 1) AS INTEGER) AS NID
FROM RDB$DATABASE';