DB2 10.5 for Linux, UNIX, and Windows

Cursor blocking

Cursor blocking is a technique that reduces overhead by having the database manager retrieve a block of rows in a single operation.

These rows are stored in a cache in the DB2® client while they are processed. The cache is allocated when an application issues an OPEN CURSOR request, and is deallocated when the cursor is closed. When all the rows have been processed, another block of rows is retrieved.

Use the BLOCKING option on the PREP or BIND commands along with the following parameters to specify the type of cursor blocking:
UNAMBIG
For cursors that are specified with the FOR READ ONLY clause, blocking occurs.

Cursors that are not declared with the FOR READ ONLY or FOR UPDATE clause which are not ambiguous and are read-only will be blocked. Ambiguous cursors will not be blocked.

ALL
For cursors that are specified with the FOR READ ONLY clause or are not specified as FOR UPDATE, blocking occurs.
NO
Blocking does not occur for any cursor.

For the definition of a read-only cursor and an ambiguous cursor, refer to the DECLARE CURSOR statement.