[DB2 V9] Lobs and FETCH WITH CONTINUE

Walter Janißen

[DB2 V9] Lobs and FETCH WITH CONTINUE
Hi

I want to use for the first time LOBs with FETCH WITH CONTINUE, but have problems to do so. I want to read the statement-text from my own DSN_STATEMENT_CACHE_TABLE using a COBOL-program.

So I declared my Cursor as follows:

EXEC SQL
DECLARE STMTID_STMT CURSOR FOR
SELECT STMT_TEXT
FROM V011570.DSN_STATEMENT_CACHE_TABLE
WHERE STMT_ID = :QUERY-QUERY-NR
FETCH FIRST 1 ROW ONLY
END-EXEC

After OPEN of that cursor, I do my first FETCH, which works fine:

EXEC SQL
FETCH WITH CONTINUE STMTID_STMT
INTO :SYSTMT-STMT-X
END-EXEC

I got my SQLCODE 0 with SQLWARN1 equals 'W'. The real length of the statement in the CACHE_TABLE is 7929 Bytes and my host-variable has a length of 3500 bytes. When I execute the next FETCH:

EXEC SQL
FETCH CURRENT CONTINUE STMTID_STMT
INTO :SYSTMT-STMT-X
END-EXEC

I got SQLCODE +100. What am I missing or what is going wrong here?

Walter

ITERGO


_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.idug.org/solutions-journal.html - home of the IDUG Solutions Journal
Technical atricles from world famous authors in DB2's most prestigious, peer reviewed
magazine now on-line!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L

Walter Janißen

Re: [DB2 V9] Lobs and FETCH WITH CONTINUE
(in response to Walter Janißen)
Hi

Just for your information: There is an open problem, which describes just
that: PK99730

_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.idug.org/rug/index.html - with almost 150 IDUG Regional User Groups,
there is probably one near you!
Regional User Groups are your local connection to the Worldwide DB2 User Community
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L