Subject | Find Generator Value Used after Insert Trigger |
---|---|
Author | garthtissington |
Post date | 2004-05-27T23:26:40Z |
I gave a Generator and it is used in a trigger to automatically
populate a primary key field. Let's say the primary key is KEY_ID
When I execute a statement like
INSERT (F1,F2,F3) values (1,2,3);
KEY_ID is automatically generator correctly. Great.
How can I find out which Generator ID value was used? I know if
Could get the current generator value but it may not be accurate as
there may have been an insert from another process between my insert
and my retrieval of teh current GEN_ID.
Incidentally, I'm Using Delphi and IBObjects.
Thank you
p.s. I know I could also get the gen ID and include it in the INSERT
statement. This has a different problem in that I chew through a
lot of ID numbers when proposed inserts are cancelled or aborted
populate a primary key field. Let's say the primary key is KEY_ID
When I execute a statement like
INSERT (F1,F2,F3) values (1,2,3);
KEY_ID is automatically generator correctly. Great.
How can I find out which Generator ID value was used? I know if
Could get the current generator value but it may not be accurate as
there may have been an insert from another process between my insert
and my retrieval of teh current GEN_ID.
Incidentally, I'm Using Delphi and IBObjects.
Thank you
p.s. I know I could also get the gen ID and include it in the INSERT
statement. This has a different problem in that I chew through a
lot of ID numbers when proposed inserts are cancelled or aborted