f2s_table_current_lock_state¶

Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers

Syntax

**There is no set_attribute.  This attribute is read only.**
get_attribute f2s_table_current_lock_state of {FileNumber} to {variable}

Parameter

Description

FileNumber

Number of the file (filename.File_Number)

variable

Boolean Variable. True, the file is locked, false the file is unlocked.

Description

This read-only attribute is used to determine the status of table lock for a particular table. Table locking is done during transactions to maintain atomicity. In DataFlex, this is usually done with the REREAD/UNLOCK, Begin_Transaction/End_Transaction commands or when using a Data Dictionary to execute the transaction.

Examples

get_attribute

Boolean bLocked

Get_Attribute f2s_table_current_lock_state of Customer.File_Number to bLocked
If (bLocked) Showln "Customer is locked"
Else Showln "Customer is not locked"

Clear Customer
Find ge Customer by Index.1
Reread
Get_Attribute f2s_table_current_lock_state of Customer.File_Number to bLocked
If (bLocked) Showln "Customer is locked"
Else Showln "Customer is not locked"
Unlock

In the above example, the first time f2s_table_current_lock_state is checked, it should be unlocked. The second time, it should be locked.

Replaces: DF_FILE_LOCK_RECORD_STATUS