Skip to content

DF_FILE_DUMMY_UPDATE_COLUMN

The number of the dummy update column.

Level

Table

Supported by

The DataFlex ODBC Driver

Type

Integer, permanent

Access

Read / Write

Values

1 .. number of columns in the table.

Syntax

Use cli.pkg
Get_Attribute DF_FILE_DUMMY_UPDATE_COLUMN of {tableNumber} to {IntegerVariable}
Set_Attribute DF_FILE_DUMMY_UPDATE_COLUMN of {tableNumber} to {IntegerVariable}

Remarks

The attribute stores the number of the column used when the dummy update mechanism is active. When using ODBC, it is possible to connect to a wide variety of databases, and even non-databases. The locking mechanisms supported by these databases vary from sophisticated to simple to none at all. The DataFlex ODBC Driver attempts to use a mechanism called positioned update. Desktop databases usually do not support positioned updates. In these cases, a different update mechanism, called SQLSetPos, which allows for records to be locked, is used. If the back end does not support exclusive locks on records, the driver will perform a “dummy update” to lock the record. This mechanism will ensure that records are locked when they are found while in a transaction. Since most ODBC drivers do not support table locking, there is a difference between DataFlex locking and ODBC locking.

The dummy update mechanism updates a record (without changing any field value) directly after it has been found. By default, the record identity column is set to the value just retrieved from the find. This happens in the find logic. In a standard table, there is no record identity, and the dummy update column should be set. In a recnum table, if the record identity column is not "updatable" (it could be an auto-increment, for example), you can set up an alternative column by using the attribute.

Usually, this will be set in the intermediate file keyword by using the keyword Dummy_Update_Column.

Note that you only need to set a dummy update column if the database only supports SQLSetPos and it does not support exclusive locks to be set by SQLSetPos.

See Transactions for more information.