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
 

 

Getting sqlcode 100 even if the pgm getting correct value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Mar 07, 2007 11:26 am    Post subject: Getting sqlcode 100 even if the pgm getting correct value
Reply with quote

i have coded a cobol db2 pgm in whih i am acessing a table and getting one value frm thr

but i am getting sqlcode of 100 even though the program is getting correct value frm the table , i shud get get sqlcode 0 but getting 100


pls help
Back to top
View user's profile Send private message

vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Wed Mar 07, 2007 11:57 am    Post subject:
Reply with quote

Please find the below reasons

Explanation: One of the following conditions occurred:

o No row met the search conditions specified in an UPDATE or DELETE
statement.

o The result of a SELECT INTO statement was an empty table.

o The result of the subselect of an INSERT statement is empty.

o A FETCH statement was executed when the cursor was positioned after
the last row of the result table.
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Wed Mar 07, 2007 11:59 am    Post subject:
Reply with quote

How do u know that the program is getting correct value from table?

In the program, what r u doing if u get an sql code of 100?

As far as i know, u l get an sql code of 100 if there is no data in the table for the executed query..

provide some more deatils about ur problem
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Mar 07, 2007 12:00 pm    Post subject:
Reply with quote

Quote:
Please find the below reasons

Explanation: One of the following conditions occurred:

o No row met the search conditions specified in an UPDATE or DELETE
statement.

o The result of a SELECT INTO statement was an empty table.

o The result of the subselect of an INSERT statement is empty.

o A FETCH statement was executed when the cursor was positioned after
the last row of the result table.


thnx 4 help but table is not empty and data is thr and i am not using any cursors, i'm using just a simple select query with no updates,inserts or delete

and i am getting correct value also but only thing is dat sql code is 100 instead of 0
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Mar 07, 2007 12:04 pm    Post subject:
Reply with quote

Quote:
How do u know that the program is getting correct value from table?

In the program, what r u doing if u get an sql code of 100?

As far as i know, u l get an sql code of 100 if there is no data in the table for the executed query..

provide some more deatils about ur problem


i manually went into the table to see the correct value

in my pgm if sqlcode is not 0 i am writing that record in file2 else writing in file1 ..... the record is written in file1 ...i dont know y i am getting 100
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Mar 07, 2007 12:33 pm    Post subject:
Reply with quote

Hi There,

Would u please paste ur code
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Wed Mar 07, 2007 12:54 pm    Post subject:
Reply with quote

u said

'' IF SQL CODE NOT= 0,
WRITE FILE-2
ELSE
WRITE FILE-1"

so if the sql code is 0, it l write in file 1. and u r getting that!!!

how do u come to the conclusion that u r getting sql code 0f 100.

can u post ur query here?
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Mar 07, 2007 3:30 pm    Post subject:
Reply with quote

Quote:
u said

'' IF SQL CODE NOT= 0,
WRITE FILE-2
ELSE
WRITE FILE-1"

so if the sql code is 0, it l write in file 1. and u r getting that!!!

how do u come to the conclusion that u r getting sql code 0f 100.

can u post ur query here?


yrs u r correct i am getting wat i want but when i display sql code it is 100
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Wed Mar 07, 2007 3:50 pm    Post subject:
Reply with quote

can u please post the code here?????? icon_confused.gif
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Wed Mar 07, 2007 5:19 pm    Post subject:
Reply with quote

I think you have not put the display statement appropriately. If it is in file1 then sqlcode should be 0. It went to file1 since sqlcode was 0. Now it cannot be hundred. Make sure you are displaying the SQLCODE at the right place. No way DB2 principles can go wrong all of a sudden -icon_smile.gif
Most of the time it would be our mistakes. Please look into the code carefully.
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
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts SQLCODE-000000080N priya91 DB2 1 Mon Feb 01, 2016 4:35 pm
No new posts print out the correct info in LOOP? jackzhang75 CLIST & REXX 7 Wed Dec 23, 2015 10:39 pm
No new posts Need to understand SQLCODE = 12 rohanthengal DB2 3 Thu Nov 05, 2015 11:22 am
No new posts SQLCODE -922 in Batch-Cics program tr... kishpra CICS 2 Thu Sep 10, 2015 12:36 pm


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