View previous topic :: View next topic
|
Author |
Message |
lalitha.rayala5
New User
Joined: 25 Aug 2010 Posts: 10 Location: Bangalore, India
|
|
|
|
Hi,
Can anyone please clarify my issue below.
I am running the below query in Spufi. In the output dataset 1 record is being displayed but showing Sqlcode 100. Please let me how this happens.
SELECT distinct
WIDTH
,SUFFIX_LGTH_REQ
,CMDTY_CODE_DESC_1
,CMDTY_CODE_DESC_2
,SUFFIX_REQUIRED
FROM
P.TA0001
WHERE
COMMODITY_CODE = '123519'
AND SUFFIX = '099'
output dataset:
---------+---------+---------+---------+---------+---------+---------+
WIDTH SUFFIX_LGTH_REQ CMDTY_CODE_DESC_1
---------+---------+---------+---------+---------+---------+---------+
.00000 N LEVELROCK 2500 UNDERLAY 2700# BG
.00000 N LEVELROCK 2500 UNDERLAY 2700# BG
DSNE610I NUMBER OF ROWS DISPLAYED IS 2
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
Thanks,
Lalitha Rayala. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10874 Location: italy
|
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Quote: |
Please let me how this happens |
More than likely:
1) Your where clause is incorrect for the datatype of the columns
2) You are not connected to the correct db2 subsystem
3) Your table qualifier is incorrect
Make your vote.... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10874 Location: italy
|
|
|
|
the sql code 100 is a SUCCESS SQL CODE, not an error one
it happens because SPUFI blindly display the sql code from the <last executed> command
a sql code 100 is like the EOF indicator ...
fetch, fetch, ... , fetch with sql code 100 ==> no more rows ( end of file / no more rows )
in COBOL ( plain file access )
read, read, .... , read and raise the EOF condition ( end of file / no more records )
the general logic is the same in bothe cases
the query/read was <successful> it's up to the program to determine if any rows were returned or if any records were read |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Thank you Enrico,
I could not see the forrest for the trees.
The rows were found and displayed:
Code: |
.00000 N LEVELROCK 2500 UNDERLAY 2700# BG
.00000 N LEVELROCK 2500 UNDERLAY 2700# BG
DSNE610I NUMBER OF ROWS DISPLAYED IS 2
|
|
|
Back to top |
|
|
|