Description
Provides a method for coordinating access to tables, rows, or columns by setting locks
Syntax
Lock(tablename, key, columnlist, locktype)
Parameters
The Lock routine has the following parameters.
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Tablename | Specifies the name of the table to lock. | ||||||||||
Key | Key of the row to lock. If null, the entire table is locked. | ||||||||||
columnList | An @fm delimited list of columns to lock. If the columnList is null the entire record is locked. | ||||||||||
Locktype | Set one of four lock types:
|
Remarks
Since the Lock routine uses the Lock statement, it is more efficient to use the Lock statement in a BASIC+ script.
Examples
/* Lock and unlock specific columns within a row */ declare subroutine lock, unlock table = 'PRODUCTS' row = '3542-5-310-1' cols = 'DESCRIPTION':@fm:'PRICE' locktype = "" Lock(table,row,cols,locktype) status = Get_Status(errCodes) If status Then FSMsg(errCodes) End * Do Some Processing call Unlock(table,row,cols,locktype) status = Get_Status(errCodes) If status Then FSMsg(errCodes) End /* Lock and unlock a row */ declare subroutine lock, unlock table = 'PRODUCTS' row = '3542-5-310-1' cols = '' locktype = "" Lock(table,row,cols,locktype) status = Get_Status(errCodes) If status Then FSMsg(errCodes) End * Do Some Processing Unlock(table,row,cols,locktype) status = Get_Status(errCodes) If status Then FSMsg(errCodes) End