Updating the records in to the cursor
Once we open a cursor having a FOR UPDATE clause, all the rows returned by the SELECT statement are locked for our changes until a commit or a rollback is placed to release the lock.
After a TCL operation is performed, the cursor pointer gets reset and the cursor will be no longer accessible, thus results in an error when fetched further as shown below.
Thus, any TCL operation on the cursor record set has to be done only after fetching all the rows from the cursor context area using a loop process similar to the above listing example.
The row limiting clause introduced in the Oracle version 12c, Fetch First ..
Using SQL in RPGLE programs is easier than you think.
Making the move from RPG native file IO to SQL database IO is really quite straightforward.
Rows Only does not seem to work with the FOR UPDATE clause.