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
 

 

Sql Code -803

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

Moderator


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

PostPosted: Thu Jun 07, 2012 10:12 am    Post subject:
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    Post subject:
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

Moderator


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

PostPosted: Thu Jun 07, 2012 10:34 am    Post subject:
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    Post subject:
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

Moderator


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

PostPosted: Thu Jun 07, 2012 10:38 am    Post subject:
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    Post subject:
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

Moderator


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

PostPosted: Thu Jun 07, 2012 10:52 am    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Thu Jun 07, 2012 11:03 am    Post subject:
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    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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 2 Thu Jan 12, 2017 12:02 pm


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