lock table Command

In transactions, you can explicitly lock a table with the lock table command.

The table locks are released at the end of the transaction.

lock table allows you to specify a wait period. If the table lock cannot be granted within the wait period, an error message is printed, but the transaction is not rolled back.

See lock table in the Adaptive Server Reference Manual for an example of a stored procedure that uses lock time-outs, and checks for an error message. The procedure continues to execute if it was run by the System Administrator, and returns an error message to other users.