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

Sql Code -803


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

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Thu Jun 07, 2012 9:42 am
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jun 07, 2012 10:12 am
Reply with quote

Is your program trying to perform an insert multiple times ?
Back to top
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Thu Jun 07, 2012 10:32 am
Reply with quote

Yes I have a input file with several records and I am doing Insert 2300-INSERT-TABLE-DATA Until EOF.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jun 07, 2012 10:34 am
Reply with quote

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
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Thu Jun 07, 2012 10:36 am
Reply with quote

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 icon_sad.gif
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jun 07, 2012 10:38 am
Reply with quote

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
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Thu Jun 07, 2012 10:45 am
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jun 07, 2012 10:52 am
Reply with quote

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
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Thu Jun 07, 2012 10:56 am
Reply with quote

okay

yes I got it

Thank you so much for help

Thanks a lot icon_razz.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 07, 2012 11:03 am
Reply with quote

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
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top