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

# export_records_to_table

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.export_records_to_table"> <span className="sig-name descname"><span className="pre">export\_records\_to\_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">remote\_query</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">''</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#L28585"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Exports records from source table to the specified target table in an external database.</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 the data will be exported to remote database, in \[schema\_name.]table\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a>.</p>
            </div>

            <div className="dt">remote\_query (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Parameterized insert query to export gpudb table data into remote database. The default value is ‘’.</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>batch\_size</strong> – Batch size, which determines how many rows to export per round trip. The default value is ‘200000’.</p>
                </li>

                <li>
                  <p><strong>datasink\_name</strong> – Name of an existing external data sink to which table name specified in input parameter <span className="em">table\_name</span> will be exported.</p>
                </li>

                <li>
                  <p><strong>jdbc\_session\_init\_statement</strong> – Executes the statement per each JDBC session before doing actual load. The default value is ‘’.</p>
                </li>

                <li>
                  <p><strong>jdbc\_connection\_init\_statement</strong> – Executes the statement once before doing actual load. The default value is ‘’.</p>
                </li>

                <li>
                  <p><strong>remote\_table</strong> – Name of the target table to which source table is exported. When this option is specified remote\_query cannot be specified. The default value is ‘’.</p>
                </li>

                <li>
                  <p><strong>use\_st\_geomfrom\_casts</strong> – Wraps parameterized variables with st\_geomfromtext or st\_geomfromwkb based on source column type. 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>

                <li>
                  <p><strong>use\_indexed\_parameters</strong> – Uses \$n style syntax when generating insert query for remote\_table option. 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">table\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Value of input parameter <span className="em">table\_name</span>.</p>
            </div>

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

            <div className="dd">
              <p>Number of records inserted into the target table.</p>
            </div>

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

            <div className="dd">
              <p>Number of records skipped.</p>
            </div>

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

            <div className="dd">
              <p>\[Not yet implemented] Number of records updated within the target 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>
