Home > Contents > Index >
LOCK
Locks a record for the current user in a tracked table.
Syntax
<LOCK TABLE="TABLE_NAME"
ASSET="PRIMARY_KEY"/>Parameters
TABLE (required)
- Name of the tracked table.
ASSET (required)
- Value of the primary key for the row to lock.
Description
The
LOCK
tag locks a record for the current user in a tracked table. Once a row is locked, the current user can modify fields in the row. The current user must have write access to the table.errno
The possible values of
errno
include:
Value Description -1000 Command failure. Check theerrdetail
variable for the specific error.Example
This example assumes all
LOCK
parameters are exposed on an HTML form. It first checks whether the parameters exist, clears any values fromerrno
, and then locks the row.
<!-- Make sure required parameters exist --> <IF
COND="IsVariable.tablename=false"> <THEN> <SETVAR
NAME="tablename" VALUE=""/> </THEN> </IF> <IF
COND="IsVariable.asset=false"> <THEN> <SETVAR
NAME="asset" VALUE=""/> </THEN> </IF> <!-- clear out errno --> <SETVAR
NAME="errno" VALUE="0"/> <!-- do the lock --> <LOCK TABLE="Variables.tablename" ASSET="Variables.asset"/> <!-- See if lock succeeded --> <IF
COND="Variables.errno=0"> <THEN> <!-- if succeeded, note it--> Lock succeeded for <CSVAR
NAME="Variables.asset"/> <BR/> </THEN> <ELSE> <!-- otherwise, call an error reporting element --> Lock failed.<BR/> </ELSE> </IF>See Also
Home > Contents > Index > ![]()
FatWire XML Tag Reference
Copyright 2005,2006,2007 by FatWire Software
All rights reserved.