DF_FILE_BLOCK_SIZE
The size of the block cursor used for the table.
Level
Table
Supported by
The DataFlex SQL Drivers (SQL Server, DB2, and ODBC), revision 5 and higher.
Type
Integer, permanent
Access
Read/Write
Values
2..
Syntax
Use cli.pkg
Get_Attribute DF_FILE_BLOCK_SIZE of {tableNumber} to {IntegerVariable}
Set_Attribute DF_FILE_BLOCK_SIZE of {tableNumber} to {IntegerVariable}
Remarks
The CLI-based drivers use database cursors to access data. For every table, two database cursors may be created:
- A single row cursor for find equal operations.
- A block cursor for every other find operation.
Block cursors will retrieve multiple rows when fetching data. The default value is 10.
Using block cursors speeds up find operations and creates a form of caching. The driver will get multiple records at a time, and the next record will be fetched from memory rather than from the back end. However, using a cache introduces the risk of returning incorrect data. To mitigate this risk, a find cache timeout can be set (in milliseconds). If the time between two find operations exceeds the find cache timeout (default 10 milliseconds), the driver will fetch the data from the back end, even if not all records in the cache have been processed. The find cache timeout can be configured using the Find_Cache_Timeout driver configuration keyword.
This attribute can be set both inside and outside of a Structure_Start ... Structure_End operation. The value of this attribute is stored in the intermediate file using the intermediate file keyword Block_Size. Usually, this will be set in the intermediate file.
Example
The sample procedure below shows the current block size for a table.
Procedure ShowBlockSize Handle hTable
Integer iBlockSize
String sTable
Get_Attribute DF_FILE_LOGICAL_NAME Of hTable To sTable
Get_Attribute DF_FILE_BLOCK_SIZE Of hTable To iBlockSize
Showln "The block size for " sTable " is: " iBlockSize
End_Procedure