guides:programming:programmers_reference_manual:unlock_subroutine

Unlock subroutine

Releases locked records.

Unlock(tablename,rowIDs,columnList,locktype)

The function has the following parameters:

ParameterDescription
tablenameThe tablename containing the row to be unlocked.
rowIDsAn @fm delimited list of keys to unlock. If null the entire table is unlocked.
columnListAn @fm delimited list of columns to unlock. If the columnList is null the entire record is unlocked.
lockTypeReturns the prior locktype of the record.

Since the Unlock routine uses the Unlock statement, it is more efficient to use the Unlock statement in a BASIC+ script.

The Unlock routine uses Set_Status for error handling. In order to process errors use the Get_Status() function.

/* 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
  • guides/programming/programmers_reference_manual/unlock_subroutine.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1