> ## 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.

# delete_records

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.delete_records"> <span className="sig-name descname"><span className="pre">delete\_records</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">expressions</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">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#L26648"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Deletes record(s) matching the provided criteria from the given table. The record selection criteria can either be one or more input parameter <span className="em">expressions</span> (matching multiple records), a single record identified by <span className="em">record\_id</span> options, or all records when using <span className="em">delete\_all\_records</span>. Note that the three selection criteria are mutually exclusive. This operation cannot be run on a view. The operation is synchronous meaning that a response will not be available until the request is completely processed and all the matching records are deleted.</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 from which to delete records, in \[schema\_name.]table\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a>. Must contain the name of an existing table; not applicable to views.</p>
            </div>

            <div className="dt">expressions (<span className="em">list of str</span>) –</div>

            <div className="dd">
              <p>A list of the actual predicates, one for each select; format should follow the guidelines provided <a className="reference external" href="/content/concepts/expressions/">here</a>. Specifying one or more input parameter <span className="em">expressions</span> is mutually exclusive to specifying <span className="em">record\_id</span> in the input parameter <span className="em">options</span>. The user can provide a single element (which will be automatically promoted to a list internally) or a list.</p>
            </div>

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

            <div className="dd">
              <p>Optional parameters. Allowed keys are:</p>

              <ul>
                <li>
                  <p><strong>global\_expression</strong> – An optional global expression to reduce the search space of the input parameter <span className="em">expressions</span>. The default value is ‘’.</p>
                </li>

                <li>
                  <p><strong>record\_id</strong> – A record ID identifying a single record, obtained at the time of <a className="reference internal" href="#gpudb.GPUdb.insert_records" title="gpudb.GPUdb.insert_records"><code className="xref py py-meth docutils literal notranslate"><span className="pre">insertion</span> <span className="pre">of</span> <span className="pre">the</span> <span className="pre">record</span></code></a> or by calling <a className="reference internal" href="#gpudb.GPUdb.get_records_from_collection" title="gpudb.GPUdb.get_records_from_collection"><code className="xref py py-meth docutils literal notranslate"><span className="pre">GPUdb.get\_records\_from\_collection()</span></code></a> with the <span className="em">return\_record\_ids</span> option. This option cannot be used to delete records from <a className="reference external" href="/content/concepts/tables/#replication">replicated</a> tables.</p>
                </li>

                <li>
                  <p><strong>delete\_all\_records</strong> – If set to <span className="em">true</span>, all records in the table will be deleted. If set to <span className="em">false</span>, then the option is effectively ignored. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>
              </ul>

              <p>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">count\_deleted (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>Total number of records deleted across all expressions.</p>
            </div>

            <div className="dt">counts\_deleted (<span className="em">list of longs</span>) –</div>

            <div className="dd">
              <p>Total number of records deleted per expression.</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>
