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 and a block cursor for every other find operation. Block cursors will get multiple rows when fetching data. The default value is 10.

Using block cursors speeds up find operations, it also creates a form of caching. The driver will get multiple records at a time. The next record will be fetched from memory rather than from the back end. Using a cache introduces the risk of returning incorrect data. To avoid this, a find cache timeout can be set (in milliseconds). If the time between two find operation is larger than 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.

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

The sample procedure above shows the current block size for a table.