Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Pro*Cobol Cursor position holding

721941Sep 10 2009 — edited Sep 11 2009
I've gotten the error that the data is out of sequence when it goes thru (cursorx opened before this loop of do until);
START LOOP
EXEC SQL
FETCH CURSORX
INTO ...
END-EXEC.
...
COMMIT
...

EXEC SQL
SELECT ...
INTO ...
FROM CMASTER
WHERE ...
END-EXEC.
...
EXEC SQL
SELECT ...
INTO ...
FROM DMASTER
WHERE ...
END-EXEC.
...
COMMIT
...
EXEC SQL OPEN CURSORD END-EXEC.
...
EXEC SQL
FETCH CURSORD
INTO ...
END-EXEC.
...
EXEC SQL
SELECT ...
INTO ...
FROM EMASTER
WHERE ...
END-EXEC.
...
EXEC SQL
SELECT ...
INTO ...
FROM FMASTER
WHERE ...
END-EXEC.
...
EXEC SQL CLOSE CURSORD END-EXEC.
...
EXEC SQL OPEN CURSORE END-EXEC
PERFORM
EXEC SQL FETCH CURSORD INTO ... END-EXEC
UNTIL CONTACT-SW = 'Y'
EXEC SQL CLOSE CURSORD END-EXEC
...
ETC.
END LOOP.

---

My background is Mainframe COBOL... and handling something like this would be done (IBM quoted) if I got it right as;

Application:

DECLARE CURSORX CURSOR WITH HOLD FOR SELECT UDF1() ...
OPEN CURSORX
FETCH CURSORX ...
COMMIT

Care to help me out... not seeing a similar function of "WITH HOLD" to keep the cursor position when it gets back to the top of the loop.
This post has been answered by Hoek on Sep 10 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2009
Added on Sep 10 2009
3 comments
1,077 views