Subject | Re: SV: [ib-support] Porting from mysql to firebird |
---|---|
Author | Milan Babuskov |
Post date | 2003-02-21T15:55:45Z |
Datatal AB - Gauffin, Jonas wrote:
For example, many people to this:
SELECT gen_id(userid, 0) FROM RDB$DATABASE;
RDB$DATABASE is a system table that contains only one row.
You can also create a table, or stored procedure that returns one row,
and select from it.
One more thing,as Svein wrote,if you're about to insert new records do:
SELECT gen_id(userid, 1) FROM RDB$DATABASE;
to increment the value.
HTH
--
Milan Babuskov
http://fbexport.sourceforge.net
> How do I retrieve the value?You must select from something.
> Tried to execute this query through odbc, SELECT gen_id(userid, 0), and it failed. How do I retrieve the id?
>
> Userid is the name of the generator.
For example, many people to this:
SELECT gen_id(userid, 0) FROM RDB$DATABASE;
RDB$DATABASE is a system table that contains only one row.
You can also create a table, or stored procedure that returns one row,
and select from it.
One more thing,as Svein wrote,if you're about to insert new records do:
SELECT gen_id(userid, 1) FROM RDB$DATABASE;
to increment the value.
HTH
--
Milan Babuskov
http://fbexport.sourceforge.net