View previous topic :: View next topic |
Author |
Message |
Wayne S. Beginner
Joined: 09 Jan 2003 Posts: 1 Topics: 1 Location: Waco, Texas
|
Posted: Mon Jul 12, 2004 12:34 pm Post subject: How to Display RID |
|
|
In an SQL error -803 using DSNTIAR, it returns this statement:
Code: | -803 AN INSERTED OR UPDATED VALUE IS INVALID BECAUSE THE
INDEX IN INDEX SPACE indexspace-name CONSTRAINS COLUMNS
OF THE TABLE SO NO TWO ROWS CAN CONTAIN DUPLICATE
VALUES IN THOSE COLUMNS. RID OF EXISTING ROW IS '003254F'. |
The question is:
I understand that DB2 assigns the RID and it is displayed in HEX and my table does not have a rowid in it's DCLGEN. So, how do I go about displaying the DB2-assigned RID of the "existing" row. We use BMC software here if I can use it. Can I access it via SQL? Any suggestions?
Thank you for your time.
Wayne |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Jul 12, 2004 2:26 pm Post subject: |
|
|
Wayne,
A row of data in a table is stored as a record and is identified by a unique record identifier (RID). RIDs are stored in index page set data pages and identify the records that are stored in file page set data pages.
For a table space defined as LARGE or with the DSSIZE parameter, a RID is a 5-byte field, containing a 4-byte page number followed by a 1-byte page ID map entry number.
For any other table space type, a RID is a 4-byte field, containing a 3-byte page number followed by a 1-byte page ID map entry number.
If you loaded the rows using a load utility then you can use LOCATE RID DUMP to dump the records in question.
Check this link for a detailed explanation of Locating rows by key
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNUGH10/2.22.2.4.5?SHELF=&DT=20010216104113&CASE=
But if you are inserting rows via program , you can add a display of the PRIMARY key whenever you encounter a -803.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Tue Jul 20, 2004 6:49 am Post subject: |
|
|
Hello Wayne,
having BMC-Tools at hand, you have another choice. In the "Catalog Manager" of BMC there is a line command HEX. After issuing this command on table level you can give a locate- resp. find-command with a RID as input.
The only drawback: Youre userid has to have control access on the underlying VSAM dataset of that table.
regards
Christian |
|
Back to top |
|
 |
|
|