View previous topic :: View next topic |
Author |
Message |
THRIVIKRAM Beginner
Joined: 03 Oct 2005 Posts: 70 Topics: 34
|
Posted: Sat Feb 11, 2006 6:06 am Post subject: DB2 duplicate rows |
|
|
Hi,
I have a job that executes a DB2 program.In that program insertion of a table from the given input file takes place.The problem is that the job is abending with SQL RC=-803. So, i took the table name and saw its declaration in the Database.There, no colum is declared as primary key and every colum is declared as NOT NULL.
->My doubt is, if there is no primary key for that table why -803 error occurs?
->I dont know if Primary Index is declared for that table.How to check if Primary key is declared or not in the Database? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sat Feb 11, 2006 8:38 am Post subject: |
|
|
Quote: |
->My doubt is, if there is no primary key for that table why -803 error occurs?
|
THRIVIKRAM,
A table primary key is defined when the table is created. The primary key declaration will not be available in the DCLGEN of the table which is used in application programs.
So just by looking at the DCLGEN you CANNOT say that the table does NOT have a primary key. You WILL get an sql error code of -803 when you try to insert a duplicate value on the primary key.
Quote: |
->I dont know if Primary Index is declared for that table.How to check if Primary key is declared or not in the Database?
|
Check this link which tells you how to check primary and foreign keys of the table
http://mvsforums.com/helpboards/viewtopic.php?t=24&highlight=primary
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|