View previous topic :: View next topic
|
Author |
Message |
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
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 |
|
|
vicky10001 Warnings : 1 Active User
Joined: 13 Jul 2005 Posts: 136
|
|
|
|
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 |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
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 |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
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 |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
Would u please paste ur code |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
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 |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
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 |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
can u please post the code here?????? |
|
Back to top |
|
|
vini_srcna
Active User
Joined: 26 May 2005 Posts: 178 Location: Copenhagen, Denmark
|
|
|
|
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 -
Most of the time it would be our mistakes. Please look into the code carefully. |
|
Back to top |
|
|
|