The SET CONCURRENCY statement sets the concurrency option for standard cursors.
SET CONCURRENCY {LOCKCC | OPTCC | OPTCCVAL | READONLY}
After the SET CONCURRENCY statement is issued, it affects all subsequent OPEN statements. Using the DECLARE CURSOR FOR UPDATE statement has the same effect as SET CONCURRENCY LOCKCC and any reference to the SET CONCURRENCY statement is ignored. The SET CONCURRENCY statement is also ignored if you are using browse cursors.
If the LOCKCC option is used, you can choose to hold open the user-defined transaction only around each fetch. This requires that a SET FETCHBUFFER statement be issued before opening the cursor. Or you can choose to hold open the user-defined transaction for the life of the cursor. Note that holding open a transaction during LOCKCC cursor operations can significantly reduce concurrency and degrade performance.
If the OPTCC or OPTCCVAL option is used, an UPDATE WHERE CURRENT OF statement can fail if the row has been changed since the last FETCH statement. The application must be able to handle this situation.
EXEC SQL SET CONCURRENCY READONLY;
DECLARE CURSOR | SET FETCHBUFFER |
SET ANSI_DEFAULTS | SET SCROLLOPTION |
SET CURSORTYPE | Standard DB-Library Cursors |