The SET FETCHBUFFER statement sets internally the number of rows to be retrieved at one time for standard cursors.
SET FETCHBUFFER num_rows
The default is 1 if SET ANSI_DEFAULTS is ON. Otherwise, the default is 10. After this statement is issued, it affects all subsequent cursor OPEN statements. Because a FETCH statement returns only a single row, the SET FETCHBUFFER statement is for performance tuning only.
The number of fetch operations required to retrieve all data from a cursor can be reduced by setting the num_rows parameter higher than the default setting of 10. You should ensure that the client has enough available memory for you to increase this setting. You might need to reduce the default setting of the num_rows parameter if client memory is constrained or if the cursors have many columns or wide columns.
EXEC SQL SET FETCHBUFFER 5;
SET CONCURRENCY | SET SCROLLOPTION |
SET CURSORTYPE | Standard DB-Library Cursors |