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

# updateRecordsRaw

<div className="kinetica-doxygen">
  <div id="afa5f0d470237751f291fc535cff990e7" />

  <h2 className="memtitle"><span className="permalink"><a href="#afa5f0d470237751f291fc535cff990e7">◆ </a></span>updateRecordsRaw() <span className="overload">\[1/2]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1UpdateRecordsResponse">UpdateRecordsResponse</a> gpudb::GPUdb::updateRecordsRaw </td>
          <td>(</td>
          <td className="paramtype">const <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest">RawUpdateRecordsRequest</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">request\_</span></span></td>
          <td>)</td>
          <td> const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Runs multiple predicate-based updates in a single call. </p>
      <p>With the list of given expressions, any matching record's column values will be updated as provided in <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest#a08649327276a2c1ecfef5f0a574e4a95">newValuesMaps</a>. There is also an optional 'upsert' capability where if a particular predicate doesn't match any existing record, then a new record can be inserted.</p>
      <p>Note that this operation can only be run on an original table and not on a result view.</p>
      <p>This operation can update primary key values. By default only 'pure primary key' predicates are allowed when updating primary key values. If the primary key for a table is the column 'attr1', then the operation will only accept predicates of the form: "attr1 == 'foo'" if the attr1 column is being updated. For a composite primary key (e.g. columns 'attr1' and 'attr2') then this operation will only accept predicates of the form: "(attr1 == 'foo') and (attr2 == 'bar')". Meaning, all primary key columns must appear in an equality predicate in the expressions. Furthermore each 'pure primary key' predicate must be unique within a given request. These restrictions can be removed by utilizing some available options through <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest#a1414565b5a00d5872f69b34a4b37abac">options</a>.</p>
      <p>The <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> option specifies the record primary key collision policy for tables with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>, while <a className="el" href="/content/api/cpp/namespacegpudb#aba9511e40d021bad06b9dc8680f20ded">ignore\_existing\_pk</a> specifies the record primary key collision error-suppression policy when those collisions result in the update being rejected. Both are ignored on tables with no primary key.</p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">request\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest">Request</a> object containing the parameters for the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1UpdateRecordsResponse">Response</a> object containing the result of the operation. </div>
      </div>
    </div>
  </div>

  <div id="abc974f0c50ac67f437c2c388a91273d4" />

  <h2 className="memtitle"><span className="permalink"><a href="#abc974f0c50ac67f437c2c388a91273d4">◆ </a></span>updateRecordsRaw() <span className="overload">\[2/2]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1UpdateRecordsResponse">UpdateRecordsResponse</a> & gpudb::GPUdb::updateRecordsRaw </td>
          <td>(</td>
          <td className="paramtype">const <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest">RawUpdateRecordsRequest</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">request\_</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype"><a className="el" href="/content/api/cpp/structgpudb_1_1UpdateRecordsResponse">UpdateRecordsResponse</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">response\_</span></span> ) const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Runs multiple predicate-based updates in a single call. </p>
      <p>With the list of given expressions, any matching record's column values will be updated as provided in <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest#a08649327276a2c1ecfef5f0a574e4a95">newValuesMaps</a>. There is also an optional 'upsert' capability where if a particular predicate doesn't match any existing record, then a new record can be inserted.</p>
      <p>Note that this operation can only be run on an original table and not on a result view.</p>
      <p>This operation can update primary key values. By default only 'pure primary key' predicates are allowed when updating primary key values. If the primary key for a table is the column 'attr1', then the operation will only accept predicates of the form: "attr1 == 'foo'" if the attr1 column is being updated. For a composite primary key (e.g. columns 'attr1' and 'attr2') then this operation will only accept predicates of the form: "(attr1 == 'foo') and (attr2 == 'bar')". Meaning, all primary key columns must appear in an equality predicate in the expressions. Furthermore each 'pure primary key' predicate must be unique within a given request. These restrictions can be removed by utilizing some available options through <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest#a1414565b5a00d5872f69b34a4b37abac">options</a>.</p>
      <p>The <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> option specifies the record primary key collision policy for tables with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>, while <a className="el" href="/content/api/cpp/namespacegpudb#aba9511e40d021bad06b9dc8680f20ded">ignore\_existing\_pk</a> specifies the record primary key collision error-suppression policy when those collisions result in the update being rejected. Both are ignored on tables with no primary key.</p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">request\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest">Request</a> object containing the parameters for the operation. </td>
            </tr>

            <tr>
              <td className="paramdir">\[out]</td>
              <td className="paramname">response\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1UpdateRecordsResponse">Response</a> object containing the results of the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1UpdateRecordsResponse">Response</a> object containing the result of the operation (initially passed in by reference). </div>
      </div>
    </div>
  </div>
</div>
