You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Eric Pugh <ep...@upstate.com> on 2003/01/29 04:27:56 UTC

[SOURCE] Issue #TRQS131 - Should use IDENT_CURRENT('table_name') for identity

You can view the issue detail at the following URL:
<http://scarab.werken.com/scarab/issues/id/TRQS131>

Type :        Enhancement
Issue Id :    TRQS131
Reported by: Eric Pugh
             epugh@upstate.com - (epugh@upstate.com)

Details:

Summary: Should use IDENT_CURRENT('table_name') for identity
Description: Currently identities are returned by doing a select @@identity, however that has global scope.  So, if torque does an insert into table Y, and then something does another insert into table X, and then torque tries to get it's insert identity, it will return table X's identity value!  Something safer is to use the syntax:
select IDENT_CURRENT('table_name'), and thus would do:
IDENT_CURRENT('Y') and narrow the chances of getting the wrong identity, especially if there was a transaction.

Status: New
Priority: Medium
Vote: Medium