SQL Guide : solidDB® SQL statements : UNLOCK TABLE
  
UNLOCK TABLE
UNLOCK TABLE { ALL | tablename [,tablename]}
where
tablename is the name of the table to unlock. You can also specify the catalog and schema of the table by qualifying the table name.
ALL releases all table-level locks on all tables.
Usage
The UNLOCK TABLE statement unlock tables that you have locked manually by using the LOCK TABLE command with the LONG option. The LONG option allows you to hold a lock past the end of the transaction in which the lock was placed. Since there is no natural endpoint for the lock (other than the end of the transaction), you must explicitly release a LONG lock by using the UNLOCK command.
The UNLOCK TABLE command does not apply to the server’s automatic locks, or to manual locks that were not locked with the LONG option. If a lock is automatic, or if it is manual and not LONG, the server will automatically release the lock at the end of the transaction in which the lock was placed. Thus there is no need to manually unlock those locks.
When the UNLOCK TABLE command is used, it does not take effect immediately; instead, the locks are released when the current transaction is committed.
Note:
If the current transaction (the one in which the UNLOCK TABLE command was executed) is not committed (for example, if it is rolled back), the tables are not unlocked; they will remain locked until another UNLOCK TABLE command is successfully executed and committed.
The LOCK/UNLOCK commands apply only to tables. There is no command to manually lock or unlock individual records.
If you have a table named ALL, you need to use the delimited identifier feature to specify the table name.
Return values
Return value
Description
10083
Table <table_name> not locked.
13011
Table <tablename> not found.
Examples
LOCK TABLE emp IN SHARED MODE;
LOCK TABLE emp IN SHARED MODE TABLE dept IN EXCLUSIVE MODE;
LOCK TABLE emp,dept IN SHARED MODE NOWAIT;
-- Get an exclusive lock that will persist past the end of the
-- current- transaction. If you can't get an exclusive lock
-- immediately, then wait up to 60 seconds to get it.
LOCK TABLE emp, dept IN LONG EXCLUSIVE MODE WAIT 60;
-- Make the schema changes (or do whatever you needed the
-- exclusive lock for).
CALL DO_SCHEMA_CHANGES_1;
COMMIT WORK;
CALL DO_SCHEMA_CHANGES_2;
UNLOCK TABLE ALL;
-- at the end of this transaction, release locks.
...
COMMIT WORK;
...
UNLOCK TABLE “ALL”; -- Unlock the table named “ALL”.
Related reference
See also
solidDB® SQL statements