If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Identity_val_local

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-04, 13:14
ansonee ansonee is offline
Registered User
 
Join Date: Feb 2002
Location: Minneapolis, MN
Posts: 253
Identity_val_local

I just have a general question about identities:

Is it possible that when doing a SELECT IDENTITY_VAL_LOCAL inside a store procedure, that you could get the wrong identity returned?

For example, some does an insert into a row with an identity column at precisely the same time someone does an insert into the same table. Could USER A somehow get the identity that was created by USER B , and vice versa?

Any input would be helpful.

Thanks
__________________
Anthony Robinson

"If I'm curt with you, it's because time is a factor here. I think fast, I talk fast, and I need you guys to act fast if you want to get out of this. So, pretty please - with sugar on top..."
Reply With Quote
  #2 (permalink)  
Old 10-28-04, 14:05
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
The IDENTITY_VAL_LOCAL is only available locally within the level at which it was assigned. It is set to null whenever a COMMIT or ROLLBACK of a unit of work occurrred since the most recent INSERT statement of that assigned value. In other words they can't get to each other's values.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On