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 do you find a row from the RID?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How do you find a row from the RID?
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: 1746
Location: Bloomington, IL

PostPosted: Thu Sep 27, 2012 9:13 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1278
Location: Belgium

PostPosted: Fri Sep 28, 2012 2:07 pm    Post subject:
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    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 find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts how to find clist's or view library Andrew Hsia CLIST & REXX 4 Tue Jun 28, 2016 6:07 pm


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