Skip to main content
lock_table(table_name=None, lock_type=‘status’, options=)[source]

Manages global access to a table’s data. By default a table has a input parameter lock_type of read_write, indicating all operations are permitted. A user may request a read_only or a write_only lock, after which only read or write operations, respectively, are permitted on the table until the lock is removed. When input parameter lock_type is no_access then no operations are permitted on the table. The lock status can be queried by setting input parameter lock_type to status.

Parameters

table_name (str) –

Name of the table to be locked, in [schema_name.]table_name format, using standard name resolution rules. It must be a currently existing table or view.

lock_type (str) –

The type of lock being applied to the table. Setting it to status will return the current lock status of the table without changing it. Allowed values are:

  • status – Show locked status.

  • no_access – Allow no read/write operations.

  • read_only – Allow only read operations.

  • write_only – Allow only write operations.

  • read_write – Allow all read/write operations.

The default value is ‘status’.

options (dict of str to str) –

Optional parameters. The default value is an empty dict ( ).

Returns

A dict with the following entries–

lock_type (str) –

Returns the lock state of the table.

info (dict of str to str) –

Additional information.