skip to main content
Designing and coding the IP : SELECT processing : Cursor-Based SELECT processing : FETCH_BLOCK_SIZE
 

FETCH_BLOCK_SIZE

Call ( dam_getInfo(DAM_INFO_FETCH_BLOCK_SIZE) to get the option value at connection level or statement level. This information can be used when the IP is implementing cursor-based SELECT processing. It indicates the number of rows to be fetched each time EXECUTE is called. If the IP passes DAM_HDBC, connection level setting is returned, and if it passes NULL for DAM_HDBC and a valid DAM_HSTMT, statement level setting is returned. The value is returned as a short integer. The DAM_INFO_FETCH_BLOCK_SIZE value is read from the ServiceSQLFetchBlockSize service attribute. The IP can use its own setting to determine how many rows to process in each request. However, the IP will be called to fetch more rows until at least ServiceSQLFetchBlockSize rows are returned. The IP can return more rows than this setting. For a simple single table query without any post-processing, the SQL Engine will call the IP until it receives ServiceSQLFetchBlockSize results before it starts to return the results to the Client.
For a JOIN query, the SQL Engine calls IP for outer table results until it has ServiceSQLFetchBlockSize results. It then calls the IP for inner table results.