View previous topic :: View next topic
|
Author |
Message |
kushal Bothra
New User
Joined: 16 Feb 2011 Posts: 38 Location: Gurgoan
|
|
|
|
I am trying to execute below query through cobol program
EXEC SQL
INSERT INTO MRTW_SKU_PKGNG_OVRRID
VALUES (6,'E',8,9)
END-EXEC.
Its working fine in QMF but when I run cobol db2 program I get sql code -803 . My table is empty and this is the only one record I am trying to insert. The error is as :-
2300-INSERT-TABLE-DATA
** ABEND ** ** = SQLERROR
** PROGRAM ** = MRKUT003
** SQLCODE ** = 803-
** ROWS PROCESSED ** = 0
** SQLERRM ** = MRIWRSKU 0000000202
** SQLERRMC ** = MRIWRSKU 0000000202 .
Please suggest what can be the resolution |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Is your program trying to perform an insert multiple times ? |
|
Back to top |
|
|
kushal Bothra
New User
Joined: 16 Feb 2011 Posts: 38 Location: Gurgoan
|
|
|
|
Yes I have a input file with several records and I am doing Insert 2300-INSERT-TABLE-DATA Until EOF. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
I mean to say your program is trying to do an insert for same key values
chances that your input file could contain duplicates is very high |
|
Back to top |
|
|
kushal Bothra
New User
Joined: 16 Feb 2011 Posts: 38 Location: Gurgoan
|
|
|
|
Nops
I have my table empty and I am trying insert only one record so there is no chance of duplicate values. Not sure whats happening |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Are you trying to do the call to insert para more than once??
Also how many records do your input file contain?
how many times you call the insert para/section? |
|
Back to top |
|
|
kushal Bothra
New User
Joined: 16 Feb 2011 Posts: 38 Location: Gurgoan
|
|
|
|
I had called insert para only once and there is only one record in my input file.
Perform INSERT Until EOF
I think after one read it will set EOF to true and it will go into insert only once. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
kushal Bothra wrote: |
I had called insert para only once and there is only one record in my input file.
Perform INSERT Until EOF
I think after one read it will set EOF to true and it will go into insert only once. |
I doubt that logic of perform insert
What you might need is
Read file (check if end of file and set flag )
perform until eof flag
call insert
call read para again
end perform |
|
Back to top |
|
|
kushal Bothra
New User
Joined: 16 Feb 2011 Posts: 38 Location: Gurgoan
|
|
|
|
okay
yes I got it
Thank you so much for help
Thanks a lot |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Telling us the PARA-name from your program won't help us to help you. Did you check in the manuals for SQLCODE= -803. As Pandora-Box indicates about duplicate records/rows, check if the table that is the object of the insert or update operation is constrained by UNIQUE INDEX in the INDEX SPACE to have unique values in certain columns. |
|
Back to top |
|
|
|