View previous topic :: View next topic
|
Author |
Message |
sambap
New User
Joined: 04 Apr 2014 Posts: 5 Location: India
|
|
|
|
Hi,
I have cobol db2 program. there inserting the values into the table.
For some rows, though row not exist in the table I am getting -803 error(Unique index violation).
Could you please suggest, what could be the reason? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
How are you inserting values into the table?
Are you reading the file and inserting the data from the file? |
|
Back to top |
|
|
sambap
New User
Joined: 04 Apr 2014 Posts: 5 Location: India
|
|
|
|
Yes reading the file and doing some alternations as per the requirement and inserting into the table. |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi,
Have you tried to research on -803 to find out the reason?
A simple google would have given you the answer
sambap wrote: |
-803 error(Unique index violation).
Could you please suggest, what could be the reason? |
When it say Unique index violation that means you are trying to insert something duplicate which needs to be unique
Check your data and fight out which values you are trying to insert duplicate |
|
Back to top |
|
|
sambap
New User
Joined: 04 Apr 2014 Posts: 5 Location: India
|
|
|
|
Hi,
After doing all fight..I reached here Chandan.
I tested with the sample data also, row was not present before inserting. But still getting -803 |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Does your file contain unique records? |
|
Back to top |
|
|
sambap
New User
Joined: 04 Apr 2014 Posts: 5 Location: India
|
|
|
|
Yes..It is having unique records. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
sambap wrote: |
Yes..It is having unique records. |
I am afraid the file read is not ok
Could you post the code within code tags? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you receive a -803 when you attempt to insert a duplicate.
either you have dups in your input, or you have a logic error in your program,
because you are attempting to insert a row which is causing a duplicate index.
if you can not validate your input,
suggest you put in a few DISPLAYs in your program.
display record read.
display row to be inserted.
display db2 return code after insert. |
|
Back to top |
|
|
|