Hi,
I have a program which has a Cursor with 2 columns declared, but only one field is fetched during FETCH cursor.
the code is running fine in produciton.
The Declare stmnt:
Code:
DECLARE ACCOUNT-CURSOR CURSOR FOR
SELECT
AC_XTNL_NO,
AC_XTNLNO_END_CDT
FROM
The fetch stmnt:
Code:
EXEC SQL
FETCH ACCOUNT-CURSOR
INTO :CRF-AC-XTNL-NO
END-EXEC.
Why this is not giving any error?. Is it because the last field being missed?
My understanding so far - the number of columns declared in the cursor should be fetched.
Joined: 18 Nov 2006 Posts: 3158 Location: Tucson AZ
vijikesavan wrote:
The Declare stmnt:
Code:
DECLARE ACCOUNT-CURSOR CURSOR FOR
SELECT
AC_XTNL_NO,
AC_XTNLNO_END_CDT
FROM
The fetch stmnt:
Code:
EXEC SQL
FETCH ACCOUNT-CURSOR
INTO :CRF-AC-XTNL-NO
END-EXEC.
Why this is not giving any error?. Is it because the last field being missed?
My understanding so far - the number of columns declared in the cursor should be fetched.
I'd be guessing that DB2 is being nice to you since you only asked for the one column. I'd think you would get both if the fetch had two host variables to put both in.....
Just guessing....