Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

-803 Error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: -803 Error
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    Post subject:
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    Post subject: Reply to: -803 Error
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Wed Mar 18, 2009 5:25 pm    Post subject: Reply to: -803 Error
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am
No new posts DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us