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

# gpudb::AppendRecordsRequest

> gpudb::AppendRecordsRequest — Kinetica C++ API

<div className="kinetica-doxygen">
  <div className="contents">
    <p>A set of parameters for <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#ac902ab53fb7c2f952e232315b7cb6536">GPUdb::appendRecords</a>. <a href="#details">More...</a></p>
    <p><code>#include \<<a className="el" href="/content/api/cpp/append__records_8h_source">gpudb/protocol/append\_records.h</a>></code></p>

    <table className="memberdecls">
      <tr className="heading">
        <td colSpan="2">
          <h2 className="groupheader"> Public Member Functions</h2>
        </td>
      </tr>

      <tr className="memitem:a0c1219c7d1686c43eac3d8ff32cad3e7" id="r_a0c1219c7d1686c43eac3d8ff32cad3e7">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a0c1219c7d1686c43eac3d8ff32cad3e7">AppendRecordsRequest</a> ()</td>
      </tr>

      <tr className="memdesc:a0c1219c7d1686c43eac3d8ff32cad3e7">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Constructs an <a className="el" href="/content/api/cpp/structgpudb_1_1AppendRecordsRequest" title="A set of parameters for GPUdb::appendRecords.">AppendRecordsRequest</a> object with default parameters. <br /></td>
      </tr>

      <tr className="separator:a0c1219c7d1686c43eac3d8ff32cad3e7">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a25a53ef4adcb75b3370778233adfc1e6" id="r_a25a53ef4adcb75b3370778233adfc1e6">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a25a53ef4adcb75b3370778233adfc1e6">AppendRecordsRequest</a> (const std::string \&tableName\_, const std::string \&sourceTableName\_, const std::map\< std::string, std::string > \&fieldMap\_, const std::map\< std::string, std::string > \&options\_)</td>
      </tr>

      <tr className="memdesc:a25a53ef4adcb75b3370778233adfc1e6">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Constructs an <a className="el" href="/content/api/cpp/structgpudb_1_1AppendRecordsRequest" title="A set of parameters for GPUdb::appendRecords.">AppendRecordsRequest</a> object with the specified parameters. <br /></td>
      </tr>

      <tr className="separator:a25a53ef4adcb75b3370778233adfc1e6">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>
    </table>

    <table className="memberdecls">
      <tr className="heading">
        <td colSpan="2">
          <h2 className="groupheader"> Public Attributes</h2>
        </td>
      </tr>

      <tr className="memitem:a1f38b6189aefb233a3a6820263f063ac" id="r_a1f38b6189aefb233a3a6820263f063ac">
        <td className="memItemLeft" align="right" valign="top">std::string </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a1f38b6189aefb233a3a6820263f063ac">tableName</a></td>
      </tr>

      <tr className="memdesc:a1f38b6189aefb233a3a6820263f063ac">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">The table name for the records to be appended, in \[ schema\_name. <br /></td>
      </tr>

      <tr className="separator:a1f38b6189aefb233a3a6820263f063ac">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a007088ffb6142dd12803205edb8772ff" id="r_a007088ffb6142dd12803205edb8772ff">
        <td className="memItemLeft" align="right" valign="top">std::string </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a></td>
      </tr>

      <tr className="memdesc:a007088ffb6142dd12803205edb8772ff">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">The source table name to get records from, in \[ schema\_name. <br /></td>
      </tr>

      <tr className="separator:a007088ffb6142dd12803205edb8772ff">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a2cf9a4beaa61e288eaf21061283eeb2c" id="r_a2cf9a4beaa61e288eaf21061283eeb2c">
        <td className="memItemLeft" align="right" valign="top">std::map\< std::string, std::string > </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a2cf9a4beaa61e288eaf21061283eeb2c">fieldMap</a></td>
      </tr>

      <tr className="memdesc:a2cf9a4beaa61e288eaf21061283eeb2c">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Contains the mapping of column names from the target table (specified by <a className="el" href="#a1f38b6189aefb233a3a6820263f063ac">tableName</a>) as the keys, and corresponding column names or expressions (e.g., 'col\_name+1') from the source table (specified by <a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a>). <br /></td>
      </tr>

      <tr className="separator:a2cf9a4beaa61e288eaf21061283eeb2c">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a7bec9687774ce42831ebafd16410a1a7" id="r_a7bec9687774ce42831ebafd16410a1a7">
        <td className="memItemLeft" align="right" valign="top">std::map\< std::string, std::string > </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a7bec9687774ce42831ebafd16410a1a7">options</a></td>
      </tr>

      <tr className="memdesc:a7bec9687774ce42831ebafd16410a1a7">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Optional parameters. <br /></td>
      </tr>

      <tr className="separator:a7bec9687774ce42831ebafd16410a1a7">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>
    </table>

    <h2 className="groupheader">Detailed Description</h2>

    <div className="textblock">
      <p>A set of parameters for <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#ac902ab53fb7c2f952e232315b7cb6536">GPUdb::appendRecords</a>. </p>
      <p>Append (or insert) all records from a source table (specified by <a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a>) to a particular target table (specified by <a className="el" href="#a1f38b6189aefb233a3a6820263f063ac">tableName</a>). The field map (specified by <a className="el" href="#a2cf9a4beaa61e288eaf21061283eeb2c">fieldMap</a>) holds the user specified map of target table column names with their mapped source column names. </p>
      <p className="definition">Definition at line <a className="el" href="/content/api/cpp/append__records_8h_source#l00022">22</a> of file <a className="el" href="/content/api/cpp/append__records_8h_source">append\_records.h</a>.</p>
    </div>

    <h2 className="groupheader">Constructor & Destructor Documentation</h2>
    <h2 className="memtitle"><span className="permalink"><a href="#a0c1219c7d1686c43eac3d8ff32cad3e7">◆ </a></span>AppendRecordsRequest() <span className="overload">\[1/2]</span></h2>

    <div className="memitem">
      <div className="memproto">
        <table className="mlabels">
          <tr>
            <td className="mlabels-left">
              <table className="memname">
                <tr>
                  <td className="memname">gpudb::AppendRecordsRequest::AppendRecordsRequest </td>
                  <td>(</td>

                  <td className="paramname">
                    <span className="paramname">
                      <span className="em" />
                    </span>
                  </td>

                  <td>)</td>

                  <td />
                </tr>
              </table>
            </td>

            <td className="mlabels-right"> <span className="mlabels"><span className="mlabel inline">inline</span></span> </td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Constructs an <a className="el" href="/content/api/cpp/structgpudb_1_1AppendRecordsRequest" title="A set of parameters for GPUdb::appendRecords.">AppendRecordsRequest</a> object with default parameters. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/append__records_8h_source#l00027">27</a> of file <a className="el" href="/content/api/cpp/append__records_8h_source">append\_records.h</a>.</p>
      </div>
    </div>

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

    <div className="memitem">
      <div className="memproto">
        <table className="mlabels">
          <tr>
            <td className="mlabels-left">
              <table className="memname">
                <tr>
                  <td className="memname">gpudb::AppendRecordsRequest::AppendRecordsRequest </td>
                  <td>(</td>
                  <td className="paramtype">const std::string &</td>
                  <td className="paramname"><span className="paramname"><span className="em">tableName\_</span></span>, </td>
                </tr>

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

                  <td />

                  <td className="paramtype">const std::string &</td>
                  <td className="paramname"><span className="paramname"><span className="em">sourceTableName\_</span></span>, </td>
                </tr>

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

                  <td />

                  <td className="paramtype">const std::map\< std::string, std::string > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">fieldMap\_</span></span>, </td>
                </tr>

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

                  <td />

                  <td className="paramtype">const std::map\< std::string, std::string > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">options\_</span></span> )</td>
                </tr>
              </table>
            </td>

            <td className="mlabels-right"> <span className="mlabels"><span className="mlabel inline">inline</span></span> </td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Constructs an <a className="el" href="/content/api/cpp/structgpudb_1_1AppendRecordsRequest" title="A set of parameters for GPUdb::appendRecords.">AppendRecordsRequest</a> object with the specified parameters. </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">tableName\_</td>
                <td>The table name for the records to be appended, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. Must be an existing table. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">sourceTableName\_</td>
                <td>The source table name to get records from, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. Must be an existing table name. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">fieldMap\_</td>
                <td>Contains the mapping of column names from the target table (specified by <span className="em arg">tableName\_</span>) as the keys, and corresponding column names or expressions (e.g., 'col\_name+1') from the source table (specified by <span className="em arg">sourceTableName\_</span>). Must be existing column names in source table and target table, and their types must be matched. For details on using expressions, see <a href="/content/concepts/expressions/" target="_top">Expressions</a>. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">options\_</td>

                <td>
                  Optional parameters.

                  <ul>
                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#ac7a5feee95ce26edc3b564a1fffee08d">append\_records\_offset</a>: A positive integer indicating the number of initial results to skip from <span className="em arg">sourceTableName\_</span>. Default is 0. The minimum allowed value is 0. The maximum allowed value is MAX\_INT. The default value is '0'. </li>
                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#afe4f2882fd7e45971a280abe883ea6ac">append\_records\_limit</a>: A positive integer indicating the maximum number of results to be returned from <span className="em arg">sourceTableName\_</span>. Or END\_OF\_SET (-9999) to indicate that the max number of results should be returned. The default value is '-9999'. </li>
                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2f1dbdc4c899b222e30af6b5556a052e">append\_records\_expression</a>: Filter expression to apply to the <span className="em arg">sourceTableName\_</span>. The default value is ''. </li>
                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#a07602ab890c84b3862164232fe78d6ec">append\_records\_order\_by</a>: Comma-separated list of the columns to be sorted by from source table (specified by <span className="em arg">sourceTableName\_</span>), e.g., 'timestamp asc, x desc'. The <a className="el" href="/content/api/cpp/namespacegpudb#a07602ab890c84b3862164232fe78d6ec">order\_by</a> columns do not have to be present in <span className="em arg">fieldMap\_</span>. The default value is ''. </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a20a1fe73ce67985b994e3f7e2b0fe62b">append\_records\_update\_on\_existing\_pk</a>: Specifies the record collision policy for inserting source table records (specified by <span className="em arg">sourceTableName\_</span>) into a target table (specified by <span className="em arg">tableName\_</span>) with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>. If set to <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>, any existing table record with primary key values that match those of a source table record being inserted will be replaced by that new record (the new data will be "upserted"). If set to <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">false</a>, any existing table record with primary key values that match those of a source table record being inserted will remain unchanged, while the source record will be rejected and an error handled as determined by <a className="el" href="/content/api/cpp/namespacegpudb#a9316eeb63a5e01730174d5b39e4cdc07">ignore\_existing\_pk</a>. If the specified table does not have a primary key, then this option has no effect. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a>: Upsert new records when primary keys match existing records. </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>: Reject new records when primary keys match existing records. </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a05126a08aa3e2a694e354112d3cd4a5d">append\_records\_enable\_inplace\_updates</a>: Applies only when upserting (when <a className="el" href="/content/api/cpp/namespacegpudb#a20a1fe73ce67985b994e3f7e2b0fe62b">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>). If set to <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>, an existing record matched by primary key is modified in place. If set to <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">false</a>, it is updated by deleting the existing record and inserting a replacement (delete and insert), which prevents the change from being reflected in dependent materialized views until they are refreshed. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a9316eeb63a5e01730174d5b39e4cdc07">append\_records\_ignore\_existing\_pk</a>: Specifies the record collision error-suppression policy for inserting source table records (specified by <span className="em arg">sourceTableName\_</span>) into a target table (specified by <span className="em arg">tableName\_</span>) with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>, only used when not in upsert mode (upsert mode is disabled when <a className="el" href="/content/api/cpp/namespacegpudb#a20a1fe73ce67985b994e3f7e2b0fe62b">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">false</a>). If set to <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>, any source table record being inserted that is rejected for having primary key values that match those of an existing target table record will be ignored with no error generated. If <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">false</a>, the rejection of any source table record for having primary key values matching an existing target table record will result in an error being raised. If the specified table does not have a primary key or if upsert mode is in effect (<a className="el" href="/content/api/cpp/namespacegpudb#a20a1fe73ce67985b994e3f7e2b0fe62b">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>), then this option has no effect. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a>: Ignore source table records whose primary key values collide with those of target table records. </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>: Raise an error for any source table record whose primary key values collide with those of a target table record. </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>.
                    </li>

                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#a728940d01e8466552445f439d78d098a">append\_records\_pk\_conflict\_predicate\_higher</a>: The record with higher value for the column resolves the primary-key insert conflict. The default value is ''. </li>
                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2783d0cf15d9c702b25d4c7f2571f4aa">append\_records\_pk\_conflict\_predicate\_lower</a>: The record with lower value for the column resolves the primary-key insert conflict. The default value is ''. </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a4403e70c31ca39faafe51ea1e9a78c95">append\_records\_truncate\_strings</a>: If set to <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>, it allows inserting longer strings into smaller charN string columns by truncating the longer strings to fit. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>.
                    </li>
                  </ul>

                  The default value is an empty map.
                </td>
              </tr>
            </table>
          </div>
        </div>

        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/append__records_8h_source#l00252">252</a> of file <a className="el" href="/content/api/cpp/append__records_8h_source">append\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="groupheader">Member Data Documentation</h2>
    <h2 className="memtitle"><span className="permalink"><a href="#a2cf9a4beaa61e288eaf21061283eeb2c">◆ </a></span>fieldMap</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::map\<std::string, std::string> gpudb::AppendRecordsRequest::fieldMap</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Contains the mapping of column names from the target table (specified by <a className="el" href="#a1f38b6189aefb233a3a6820263f063ac">tableName</a>) as the keys, and corresponding column names or expressions (e.g., 'col\_name+1') from the source table (specified by <a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a>). </p>
        <p>Must be existing column names in source table and target table, and their types must be matched. For details on using expressions, see <a href="/content/concepts/expressions/" target="_top">Expressions</a>. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/append__records_8h_source#l00286">286</a> of file <a className="el" href="/content/api/cpp/append__records_8h_source">append\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a7bec9687774ce42831ebafd16410a1a7">◆ </a></span>options</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::map\<std::string, std::string> gpudb::AppendRecordsRequest::options</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Optional parameters. </p>

        <ul>
          <li> <a className="el" href="/content/api/cpp/namespacegpudb#ac7a5feee95ce26edc3b564a1fffee08d">append\_records\_offset</a>: A positive integer indicating the number of initial results to skip from <a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a>. Default is 0. The minimum allowed value is 0. The maximum allowed value is MAX\_INT. The default value is '0'. </li>
          <li> <a className="el" href="/content/api/cpp/namespacegpudb#afe4f2882fd7e45971a280abe883ea6ac">append\_records\_limit</a>: A positive integer indicating the maximum number of results to be returned from <a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a>. Or END\_OF\_SET (-9999) to indicate that the max number of results should be returned. The default value is '-9999'. </li>
          <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2f1dbdc4c899b222e30af6b5556a052e">append\_records\_expression</a>: Filter expression to apply to the <a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a>. The default value is ''. </li>
          <li> <a className="el" href="/content/api/cpp/namespacegpudb#a07602ab890c84b3862164232fe78d6ec">append\_records\_order\_by</a>: Comma-separated list of the columns to be sorted by from source table (specified by <a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a>), e.g., 'timestamp asc, x desc'. The <a className="el" href="/content/api/cpp/namespacegpudb#a07602ab890c84b3862164232fe78d6ec">order\_by</a> columns do not have to be present in <a className="el" href="#a2cf9a4beaa61e288eaf21061283eeb2c">fieldMap</a>. The default value is ''. </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#a20a1fe73ce67985b994e3f7e2b0fe62b">append\_records\_update\_on\_existing\_pk</a>: Specifies the record collision policy for inserting source table records (specified by <a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a>) into a target table (specified by <a className="el" href="#a1f38b6189aefb233a3a6820263f063ac">tableName</a>) with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>. If set to <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>, any existing table record with primary key values that match those of a source table record being inserted will be replaced by that new record (the new data will be "upserted"). If set to <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">false</a>, any existing table record with primary key values that match those of a source table record being inserted will remain unchanged, while the source record will be rejected and an error handled as determined by <a className="el" href="/content/api/cpp/namespacegpudb#a9316eeb63a5e01730174d5b39e4cdc07">ignore\_existing\_pk</a>. If the specified table does not have a primary key, then this option has no effect. Supported values:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a>: Upsert new records when primary keys match existing records. </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>: Reject new records when primary keys match existing records. </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>.
          </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#a05126a08aa3e2a694e354112d3cd4a5d">append\_records\_enable\_inplace\_updates</a>: Applies only when upserting (when <a className="el" href="/content/api/cpp/namespacegpudb#a20a1fe73ce67985b994e3f7e2b0fe62b">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>). If set to <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>, an existing record matched by primary key is modified in place. If set to <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">false</a>, it is updated by deleting the existing record and inserting a replacement (delete and insert), which prevents the change from being reflected in dependent materialized views until they are refreshed. Supported values:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a> </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a> </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a>.
          </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#a9316eeb63a5e01730174d5b39e4cdc07">append\_records\_ignore\_existing\_pk</a>: Specifies the record collision error-suppression policy for inserting source table records (specified by <a className="el" href="#a007088ffb6142dd12803205edb8772ff">sourceTableName</a>) into a target table (specified by <a className="el" href="#a1f38b6189aefb233a3a6820263f063ac">tableName</a>) with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>, only used when not in upsert mode (upsert mode is disabled when <a className="el" href="/content/api/cpp/namespacegpudb#a20a1fe73ce67985b994e3f7e2b0fe62b">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">false</a>). If set to <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>, any source table record being inserted that is rejected for having primary key values that match those of an existing target table record will be ignored with no error generated. If <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">false</a>, the rejection of any source table record for having primary key values matching an existing target table record will result in an error being raised. If the specified table does not have a primary key or if upsert mode is in effect (<a className="el" href="/content/api/cpp/namespacegpudb#a20a1fe73ce67985b994e3f7e2b0fe62b">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>), then this option has no effect. Supported values:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a>: Ignore source table records whose primary key values collide with those of target table records. </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>: Raise an error for any source table record whose primary key values collide with those of a target table record. </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>.
          </li>

          <li> <a className="el" href="/content/api/cpp/namespacegpudb#a728940d01e8466552445f439d78d098a">append\_records\_pk\_conflict\_predicate\_higher</a>: The record with higher value for the column resolves the primary-key insert conflict. The default value is ''. </li>
          <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2783d0cf15d9c702b25d4c7f2571f4aa">append\_records\_pk\_conflict\_predicate\_lower</a>: The record with lower value for the column resolves the primary-key insert conflict. The default value is ''. </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#a4403e70c31ca39faafe51ea1e9a78c95">append\_records\_truncate\_strings</a>: If set to <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">true</a>, it allows inserting longer strings into smaller charN string columns by truncating the longer strings to fit. Supported values:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a4dc510a6c94513c747849fccae2921f1">append\_records\_true</a> </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a> </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a2a6ce357b6b7f28848b9cb643c21ddc9">append\_records\_false</a>.
          </li>
        </ul>

        <p>The default value is an empty map. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/append__records_8h_source#l00421">421</a> of file <a className="el" href="/content/api/cpp/append__records_8h_source">append\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a007088ffb6142dd12803205edb8772ff">◆ </a></span>sourceTableName</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::string gpudb::AppendRecordsRequest::sourceTableName</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>The source table name to get records from, in \[ schema\_name. </p>
        <p>\ ]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. Must be an existing table name. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/append__records_8h_source#l00275">275</a> of file <a className="el" href="/content/api/cpp/append__records_8h_source">append\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a1f38b6189aefb233a3a6820263f063ac">◆ </a></span>tableName</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::string gpudb::AppendRecordsRequest::tableName</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>The table name for the records to be appended, in \[ schema\_name. </p>
        <p>\ ]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. Must be an existing table. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/append__records_8h_source#l00266">266</a> of file <a className="el" href="/content/api/cpp/append__records_8h_source">append\_records.h</a>.</p>
      </div>
    </div>

    <hr />

    The documentation for this struct was generated from the following file:

    <ul>
      <li>gpudb/protocol/<a className="el" href="/content/api/cpp/append__records_8h_source">append\_records.h</a></li>
    </ul>
  </div>
</div>
