IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How do you find a row from the RID?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
M David Hunter

New User


Joined: 30 Jan 2012
Posts: 6
Location: United States

PostPosted: Thu Sep 27, 2012 8:47 pm
Reply with quote

I received a -532 on a DELETE. There is a constraint on a foreign key. I want to find the specific descendent row identified by the RID. So far I haven't been able to find a method of doing this. Any suggestions?

Thanks
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Sep 27, 2012 9:13 pm
Reply with quote

GuyC can probably give you a better answer, but if the table has a column with type ROWID, you can search on it.
Back to top
View user's profile Send private message
M David Hunter

New User


Joined: 30 Jan 2012
Posts: 6
Location: United States

PostPosted: Thu Sep 27, 2012 9:16 pm
Reply with quote

Unfortunately none of the columns have a type of ROWID!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Sep 27, 2012 10:26 pm
Reply with quote

if you have db2 9 or better,
you can follow the advice found here

then user your browser FIND for " Mar 30, 2011 05:22 PM",
a post by Patrick Bossman (IBM).

obviously, if you have reorg'd, you will have a problem.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Sep 28, 2012 2:07 pm
Reply with quote

as the link from dbz says :
Code:
select * from table1 A where RID(A) = 65861

where 65861 = decimal value of the hex-value you've got in the errormessage.

you could also do
Code:
select * from childtable where Foreignkeyfields in (select primarykeyfields from parenttable where your_original_delete_where_clause)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts Need to find a specific STRING COBOL Programming 11
Search our Forums:

Back to Top