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

# exportRecordsToTable

<div className="kinetica-javadoc">
  <ul className="member-list">
    <li>
      <div className="section detail" id="exportRecordsToTable(com.gpudb.protocol.ExportRecordsToTableRequest)">
        <h3>exportRecordsToTable</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableResponse" title="class in com.gpudb.protocol">ExportRecordsToTableResponse</a></span> <span className="element-name">exportRecordsToTable</span><wbr /><span className="parameters">(<a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest" title="class in com.gpudb.protocol">ExportRecordsToTableRequest</a> request)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>
        <div className="block">Exports records from source table to the specified target table in an external database.</div>

        <div className="dl notes">
          <div className="dt">Parameters:</div>
          <div className="dd"><code>request</code> - <a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest" title="class in com.gpudb.protocol"><code>Request</code></a> object containing the parameters for the operation.</div>
          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>

    <li>
      <div className="section detail" id="exportRecordsToTable(java.lang.String,java.lang.String,java.util.Map)">
        <h3>exportRecordsToTable</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableResponse" title="class in com.gpudb.protocol">ExportRecordsToTableResponse</a></span> <span className="element-name">exportRecordsToTable</span><wbr /><span className="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> tableName, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> remoteQuery, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link">Map</a>\<<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>,<wbr /><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>> options)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>
        <div className="block">Exports records from source table to the specified target table in an external database.</div>

        <div className="dl notes">
          <div className="dt">Parameters:</div>
          <div className="dd"><code>tableName</code> - Name of the table from which the data will be exported to remote database, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>.</div>
          <div className="dd"><code>remoteQuery</code> - Parameterized insert query to export gpudb table data into remote database. The default value is ''.</div>

          <div className="dd">
            <code>options</code> - Optional parameters.

            <ul>
              <li><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#BATCH_SIZE"><code>BATCH\_SIZE</code></a>: Batch size, which determines how many rows to export per round trip. The default value is '200000'. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#DATASINK_NAME"><code>DATASINK\_NAME</code></a>: Name of an existing external data sink to which table name specified in <code>tableName</code> will be exported. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#JDBC_SESSION_INIT_STATEMENT"><code>JDBC\_SESSION\_INIT\_STATEMENT</code></a>: Executes the statement per each JDBC session before doing actual load. The default value is ''. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#JDBC_CONNECTION_INIT_STATEMENT"><code>JDBC\_CONNECTION\_INIT\_STATEMENT</code></a>: Executes the statement once before doing actual load. The default value is ''. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#REMOTE_TABLE"><code>REMOTE\_TABLE</code></a>: 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 ''. </li>

              <li>
                <a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#USE_ST_GEOMFROM_CASTS"><code>USE\_ST\_GEOMFROM\_CASTS</code></a>: Wraps parameterized variables with st\_geomfromtext or st\_geomfromwkb based on source column type. Supported values:

                <ul>
                  <li><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#TRUE"><code>TRUE</code></a> </li>
                  <li><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#FALSE"><code>FALSE</code></a> </li>
                </ul>

                The default value is <a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#FALSE"><code>FALSE</code></a>.
              </li>

              <li>
                <a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#USE_INDEXED_PARAMETERS"><code>USE\_INDEXED\_PARAMETERS</code></a>: Uses \$n style syntax when generating insert query for remote\_table option. Supported values:

                <ul>
                  <li><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#TRUE"><code>TRUE</code></a> </li>
                  <li><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#FALSE"><code>FALSE</code></a> </li>
                </ul>

                The default value is <a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableRequest.Options#FALSE"><code>FALSE</code></a>.
              </li>
            </ul>

            The default value is an empty <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link"><code>Map</code></a>.
          </div>

          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/ExportRecordsToTableResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>
  </ul>
</div>
