Block

Description

Block specifies the cursor blocking factor for a database connection. The blocking factor determines the number of rows that a DataWindow object can fetch from the database at one time.

You can improve performance by using the Block DBParm parameter when you access a database in PocketBuilder.

Applies to

Syntax

Block = blocking_factor

Parameter

Description

blocking_factor

The number of rows you want the DataWindow object to fetch from the database at one time. The blocking factor can be a number from 1 to 1000, inclusive.

To turn off block fetching, set Block to 1.

Default

For most DataWindow objects, the Block default value is Block=1000.

If you specified that the DataWindow object should retrieve only as many rows as needed from the database (Retrieve.AsNeeded property), the Block default value is Block = 100.

In both cases, there is a maximum limit on the volume of data that can be retrieved of 32K per column.

NoteUsing the default blocking factor You should not have to set a non-default value for Block. In most cases, the default blocking factor used by PocketBuilder should meet your needs.

Usage

Requirements To use the Block DBParm parameter with an ODBC data source, your ODBC driver must:

The SQL Anywhere ODBC driver that comes with PocketBuilder meets both of these requirements.

For information about whether your ODBC driver meets these requirements, see the documentation that comes with your driver.

Determining the Block value PocketBuilder searches the following in this order to determine the Block value for ODBC data sources:

  1. The section for your database profile in the PocketBuilder initialization file or the value of the Transaction object DBParm property in a PocketBuilder application.

  2. The section for your ODBC driver in the pkodb25 initialization file.

If PocketBuilder does not find a Block value in these locations, it uses the default Block value for the DBMS you are accessing.

Turning off block fetching To turn off block fetching for an ODBC data source, set the Block parameter to 1.

Examples

Example 1

To set the blocking factor for DataWindow objects to 50 rows: