Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to check duplicate row insertion?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Gopal Tripathi

New User


Joined: 16 Sep 2009
Posts: 15
Location: Hyd,Ind

PostPosted: Thu Aug 04, 2011 1:40 pm    Post subject: How to check duplicate row insertion?
Reply with quote

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
View user's profile Send private message

sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Aug 04, 2011 2:12 pm    Post subject:
Reply with quote

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 icon_biggrin.gif.

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
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Aug 04, 2011 2:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
BrantleyL

New User


Joined: 03 Jun 2010
Posts: 14
Location: Dallas TX

PostPosted: Thu Aug 04, 2011 7:18 pm    Post subject:
Reply with quote

You can also get a -803 on a duplicate unique index.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us