Subject | Re: How Set Generator from Select MAX(keyrow) from MyTable |
---|---|
Author | Aage Johansen |
Post date | 2002-03-08T19:42:26Z |
enrico wrote:
---------------------------
i need to set generator with the MAX value extracted from my table.
Of course this operation are due when no user work on the DB and are
usefull only after an import from the old version of my db.
How can i do this?
---------------------------
If you are going to do this 'manually' you can use the "set generator ..."
or use a tool like ib_sql (or ibconsole).
In a program you can use
select gen_id(MYGEN,MAXVALUE-gen_id(MYGEN,0)) from rdb$database
Regards,
Aage J.
---------------------------
i need to set generator with the MAX value extracted from my table.
Of course this operation are due when no user work on the DB and are
usefull only after an import from the old version of my db.
How can i do this?
---------------------------
If you are going to do this 'manually' you can use the "set generator ..."
or use a tool like ib_sql (or ibconsole).
In a program you can use
select gen_id(MYGEN,MAXVALUE-gen_id(MYGEN,0)) from rdb$database
Regards,
Aage J.