Subject | Re: [firebird-support] To know the last inserted or deleted |
---|---|
Author | Jerome Bouvattier |
Post date | 2004-03-03T18:26:07Z |
Hi,
Then, in FB it's done the other way around. You retrieve the generated ID
from the appropriate generator *before* actually inserting records.
Select gen_id(<your generator name>, 1) from rdb$database
Then use the return ID in your insert.
Note : The system table rdb$database is used here because it is guaranteed
to hold one and only one record but any other table with the same
characteristic will do.
Regards.
--
Jerome
> ----- Original Message -----You refer to the @IDENTITY feature right ?
> From: akestion
> To: firebird-support@yahoogroups.com
> Sent: Wednesday, March 03, 2004 4:18 PM
> Subject: [firebird-support] To know the last inserted or deleted
>
> Hi again,
>
> Is it possible to find the last values inserted or deleted as in MS.
> SQLsever, thanks a tables INSERTED or DELETED.
Then, in FB it's done the other way around. You retrieve the generated ID
from the appropriate generator *before* actually inserting records.
Select gen_id(<your generator name>, 1) from rdb$database
Then use the return ID in your insert.
Note : The system table rdb$database is used here because it is guaranteed
to hold one and only one record but any other table with the same
characteristic will do.
Regards.
--
Jerome