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

# update

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.update"> <span className="sig-name descname"><span className="pre">update</span></span><span className="sig-paren">(</span><span className="em sig-param"><span className="keyword-only-separator o"><span title="Keyword-only parameters separator (PEP 3102)" className="abbr"><span className="pre">\*</span></span></span></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">expression</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">new\_values\_map</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span><span className="sig-paren">)</span><a href="https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb.py#L10892"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Runs predicate-based updates in a single call. With the given expression, any matching record’s column values will be updated as provided in input parameter <span className="em">new\_values\_map</span>.</p>
      <p>Note that this operation can only be run on an original table and not on a result view.</p>
      <p><strong>Parameters</strong></p>

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

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

            <div className="dt">expression (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>An actual predicate for the update; format should follow the guidelines <a className="reference internal" href="#gpudb.GPUdb.filter" title="gpudb.GPUdb.filter"><code className="xref py py-meth docutils literal notranslate"><span className="pre">here</span></code></a>. The user should provide a single element (which will be automatically promoted to a list internally).</p>
            </div>

            <div className="dt">new\_values\_map (<span className="em">a dict of str to optional str</span>) –</div>

            <div className="dd">
              <p>List of new values for the matching records. Each element is a (key, value) pair where the keys are the names of the columns whose values are to be updated; the values are the new values. The user can provide a single element (which will be automatically promoted to a list internally).</p>
            </div>
          </div>
        </div>
      </div>

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

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

          <div className="dl simple">
            <div className="dt">count\_updated (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>Total number of records updated.</p>
            </div>

            <div className="dt">In case of error it returns a dict - {"{"}‘status’ –</div>

            <div className="dd">
              <p>‘ERROR’, ‘message’: ‘Some error message’{"}"}</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
