Finding the key of record causing DSNU344I while loading



IBM's flagship relational database management system

Finding the key of record causing DSNU344I while loading

Postby murthydvms » Mon Feb 25, 2019 1:17 pm

When loading the data to the table, I got below message in SYSPRINT stating existence of duplicate record:

DSNU344I  -DT11 055 03:18:34.55 DSNURBXA - UNIQUE INDEX KEY DUPLICATES KEY OF INDEXED RECORD
                      AT RID X'0030008201',
                           INDEX = DB2T.index_nm,
                           TABLE = DB2T.table_nm,
                           RECNO = 1,
                           RID   = X'0030012A02'


Is there any way to find the key of the record which resulted in above error? Also as per table definition, I see no column defined as USAGE SQL TYPE IS ROWID So what is the RID Hexadecimal value denotes?
murthydvms
 
Posts: 3
Joined: Thu May 11, 2017 8:59 am
Has thanked: 0 time
Been thanked: 0 time

Re: Finding the key of record causing DSNU344I while loading

Postby expat » Mon Feb 25, 2019 6:12 pm

When you sya load, is this an initial load where the receiving table is not populated, or is this adding data to the table.

If the former, then the error is in the input dataset, and a simple sort should find the duplicate key(s)
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Finding the key of record causing DSNU344I while loading

Postby murthydvms » Mon Feb 25, 2019 7:49 pm

Table has data in it, and I tried to load (APPEND) with the records that are already present in the table.

Punch card used:
LOAD DATA LOG NO NOCOPYPEND RESUME YES REUSE      
    INDDN SYSREC00 INTO TABLE DB2T.TABLE_NM


I'm looking for the meaning of RID in the DSNU344I message.
murthydvms
 
Posts: 3
Joined: Thu May 11, 2017 8:59 am
Has thanked: 0 time
Been thanked: 0 time

Re: Finding the key of record causing DSNU344I while loading

Postby murthydvms » Tue Feb 26, 2019 11:19 pm

Found the point I was looking for:

I got confused between ROW-ID and RECORD-ID (RID).

A row ID is a value that uniquely identifies a row in a table. A column or a host variable can have a row ID data type.


The RID function returns the record ID (RID) of a row. The RID is used to uniquely identify a row.


To find the record for which this error occurred:
Convert RID value from hexadecimal to decimal --> X'0030008201' to 805339649

then use it in the below query:
SELECT * FROM TABLE_NM
WHERE RID(TABLE_NM) =  805339649


For reference:
[LURL=]https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/sqlref/src/tpc/db2z_bif_rid.html[/LURL]
[LURL=]https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/sqlref/src/tpc/db2z_rowidvalues.html[/LURL]
murthydvms
 
Posts: 3
Joined: Thu May 11, 2017 8:59 am
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post