IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

-803 Error


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nidhimishra_8

New User


Joined: 26 Nov 2008
Posts: 5
Location: Bangalore

PostPosted: Wed Mar 18, 2009 4:26 pm
Reply with quote

Hi,
I am getting -803 error while loading data in DB2.
The data which i am trying to insert is some new entries and doesn't exist in table.
There are 3 Primary keys in which 1 is time stamp and while loading we give it as current time stamp, so there is no chance of duplicate entries.

Please advise how to resolve it.

Thanks,
Nidhi
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 18, 2009 4:34 pm
Reply with quote

Quote:

so there is no chance of duplicate entries.


your analysis sucks. db2 said there is a duplicate.

Look at the sqlca and it will provide you with the index that is being violated.
Display it after receiving the -803.

or, add a little professionalism to your code
and call dsntiar with the sqlca after a -803 which will format the output
for display.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Wed Mar 18, 2009 5:08 pm
Reply with quote

display the key where you are getting the SQLCODE=-803. There must be some duplicate records.

Quote:

There are 3 Primary keys in which 1 is time stamp and while loading we give it as current time stamp, so there is no chance of duplicate entries.



when one of key for all records is current timestamp then there is a chance of having records with 2 primary keys being same. DISPLAY is the best way to find the bad record.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 18, 2009 5:21 pm
Reply with quote

you will receive a -803 on insert when any unique index is violated.

debugging -803's involves more then only concentrating on the 'PRIMARY' index.
Normally, this is known by the coder
- primary index violations afflict programs written by blind people
...problems occur when the coder/designer does an incomplete job of analysis by ignoring other indexes.

that is why I suggested looking at the sqlca
one should first look at the contents of the sqlca when receiving negative sql codes.

in the case of a -803, you first have to establish which index is being violated unstead of assuming that it is the primary.

so, stop pissing around swearing that there could not be duplicates and
1) determine the index being violated
2) use sort to find the dups (based on the offsets of the columns involved with the violated index)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Mar 18, 2009 5:25 pm
Reply with quote

Quote:
Please advise how to resolve it.


review Your analisys and coding

I would trust db2 judgment
more than Your' s or that of Your team or that of Your support
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top