> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# lock_table

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.lock_table"> <span className="sig-name descname"><span className="pre">lock\_table</span></span><span className="sig-paren">(</span><span className="em sig-param"><span className="n"><span className="pre">table\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">lock\_type</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">'status'</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">options</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">{"{"}{"}"}</span></span></span><span className="sig-paren">)</span><a href="https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb.py#L36089"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Manages global access to a table’s data. By default a table has a input parameter <span className="em">lock\_type</span> of <span className="em">read\_write</span>, indicating all operations are permitted. A user may request a <span className="em">read\_only</span> or a <span className="em">write\_only</span> lock, after which only read or write operations, respectively, are permitted on the table until the lock is removed. When input parameter <span className="em">lock\_type</span> is <span className="em">no\_access</span> then no operations are permitted on the table. The lock status can be queried by setting input parameter <span className="em">lock\_type</span> to <span className="em">status</span>.</p>
      <p><strong>Parameters</strong></p>

      <div className="blockquote">
        <div>
          <div className="dl">
            <div className="dt">table\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of the table to be locked, in \[schema\_name.]table\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a>. It must be a currently existing table or view.</p>
            </div>

            <div className="dt">lock\_type (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>The type of lock being applied to the table. Setting it to <span className="em">status</span> will return the current lock status of the table without changing it. Allowed values are:</p>

              <ul className="simple">
                <li>
                  <p><strong>status</strong> – Show locked status.</p>
                </li>

                <li>
                  <p><strong>no\_access</strong> – Allow no read/write operations.</p>
                </li>

                <li>
                  <p><strong>read\_only</strong> – Allow only read operations.</p>
                </li>

                <li>
                  <p><strong>write\_only</strong> – Allow only write operations.</p>
                </li>

                <li>
                  <p><strong>read\_write</strong> – Allow all read/write operations.</p>
                </li>
              </ul>

              <p>The default value is ‘status’.</p>
            </div>

            <div className="dt">options (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Optional parameters. The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>
          </div>
        </div>
      </div>

      <p><strong>Returns</strong></p>

      <div className="blockquote">
        <div>
          <p>A dict with the following entries–</p>

          <div className="dl simple">
            <div className="dt">lock\_type (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Returns the lock state of the table.</p>
            </div>

            <div className="dt">info (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Additional information.</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
