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: 1529
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: 1529
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: 1529
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: 1529
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 PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 3 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Help in understanding what is th... mainakdalal PL/I & Assembler 9 Mon Oct 03, 2016 8:03 pm


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