MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 duplicate rows

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
THRIVIKRAM
Beginner


Joined: 03 Oct 2005
Posts: 70
Topics: 34

PostPosted: Sat Feb 11, 2006 6:06 am    Post subject: DB2 duplicate rows Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sat Feb 11, 2006 8:38 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group