Using DB2 "predicate" for cursor



IBM's flagship relational database management system

Using DB2 "predicate" for cursor

Postby jfdutcher » Mon May 22, 2017 5:15 pm

I have pulled very simple code from IBM manual which demonstrates a simple test to determine cursor status (and I gather, avoid either -501 or -502 SQLCODES).
IF READCUR IS OPEN
EXEC SQL
CLOSE READCUR
END-EXEC
EXEC SQL
OPEN READCUR
END-EXEC
ELSE
EXEC SQL
OPEN READCUR
END-EXEC
END-IF
READCUR is defined in WS:
EXEC SQL
DECLARE READCUR CURSOR FOR
SELECT
etc.etc.

But at compile time the compiler throws a '14' return and says READCUR is undefined. The program is an old one and has run for years
but my attempt to insert the test for open cursor is stymied.
Is it that my DB2 / COBOL environment doesn't allow using DB2 predicates (at least for a cursor) ?
jfdutcher
 
Posts: 9
Joined: Mon Apr 28, 2014 10:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Using DB2 "predicate" for cursor

Postby NicC » Mon May 22, 2017 6:01 pm

Locked - discussed on the Expert's forum.

Also - nothing is "thrown" on MVS, its predecessors or its successors.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post