View previous topic :: View next topic
|
Author |
Message |
Gopal Tripathi
New User
Joined: 16 Sep 2009 Posts: 15 Location: Hyd,Ind
|
|
|
|
Is it possible when SELECTing WITH UR that duplicate rows might be returned if employee records are being updated on-line whilst the SELECT is being performed?
There is a select correlated subquery being performed on some tables(these are user tables).The result set from this is being inserted to a work table.
Sometimes while inserting it throws -803,and sometime it runs fine.Is there any way to predict the INSERT on the row not already existing in the work table. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Gopal,
with UR, basically you can select un-committed rows, not duplicates.
Quote: |
Sometimes while inserting it throws -803,and sometime it runs fine. |
Sometimes its throwing -803, because what you are trying to insert is considered as duplicate.
Sometimes it runs fine, because it is the first of its kind .
Tell us your column details and also let us know, how you are making that column unique like is it an identity column, does it reference any sequence object or you have a mechainsm in the program to make it unique.
Thanks,
Sushanth |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
What ?
I don't think a select being used for insert is ever correlated.
How can you predict? you might be able to test with exists or something.
And what has this to do with updates while selecting UR? you'll need to explain that a bit in detail. |
|
Back to top |
|
|
BrantleyL
New User
Joined: 03 Jun 2010 Posts: 14 Location: Dallas TX
|
|
|
|
You can also get a -803 on a duplicate unique index. |
|
Back to top |
|
|
|