The syntax of lock table is:
lock table table_name in {share | exclusive} mode [wait [no_of_seconds] | nowait]
The wait/nowait option allows you to specify how long the command waits to acquire a table lock if it is blocked (see “wait/nowait option of the lock table command”).
The following considerations apply to the use of lock table:You can issue
lock table only within a transaction.
You cannot use lock table on system tables.
You can first use lock table to lock a table in share mode, then use it to upgrade the lock to exclusive mode.
You can use separate lock table commands to lock multiple tables within the same transaction.
Once a table lock is obtained, there is no difference between a table locked with lock table and a table locked through lock promotion without the lock table command.
Copyright © 2005. Sybase Inc. All rights reserved. |