doc-exports/docs/dws/dev/dws_06_0230.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

446 lines
117 KiB
HTML

<a name="EN-US_TOPIC_0000001233708657"></a><a name="EN-US_TOPIC_0000001233708657"></a>
<h1 class="topictitle1">COPY</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001233708657__s8e82872062954913be9d7d26a370222b"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001233708657__a7be60e4cf7eb42fe9bce6d0bfccfdbae"><strong id="EN-US_TOPIC_0000001233708657__b51860001122926">COPY</strong> copies data between tables and files.</p>
<p id="EN-US_TOPIC_0000001233708657__a74ed086b136049ae99a36655d743bd1b"><strong id="EN-US_TOPIC_0000001233708657__b39910573122926">COPY FROM</strong> copies data from a file to a table. <strong id="EN-US_TOPIC_0000001233708657__b23650845122926">COPY TO</strong> copies data from a table to a file.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001233708657__s8b84a878cc914d469af086885a4ba6e9"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001233708657__ucd6a5af8657d49b9b5fbe1e24c70162d"><li id="EN-US_TOPIC_0000001233708657__l64168e73393743f19e9da490bffed117">If CNs and DNs are enabled in security mode , the <strong id="EN-US_TOPIC_0000001233708657__b1580320514015">COPY FROM FILENAME</strong> or <strong id="EN-US_TOPIC_0000001233708657__b5127898408">COPY TO FILENAME</strong> cannot be used. Use <strong id="EN-US_TOPIC_0000001233708657__b1770031054713">\copy</strong> to avoid this problem, for details, see "FAQs &gt; Data Import and Export &gt; How Do I Use \copy to Import and Export Data?" in the <em id="EN-US_TOPIC_0000001233708657__i11310112611527">Data Warehouse Service User Guide</em>.</li><li id="EN-US_TOPIC_0000001233708657__l9ade8c8ce3f540af98589b46a524fa9d"><strong id="EN-US_TOPIC_0000001233708657__b81261328114212">COPY</strong> applies to only tables and does not apply to views.</li><li id="EN-US_TOPIC_0000001233708657__l1a481a49024b4de7bf81c1d9df99a684">To insert data to a table, you must have the permission to insert data.</li><li id="EN-US_TOPIC_0000001233708657__l06b04e6cc01b47b5abc7bd9e0fb32655">If a list of columns is specified, <strong id="EN-US_TOPIC_0000001233708657__b43090421122926">COPY</strong> will only copy the data in the specified columns to or from the file. If there are any columns in the table that are not in the column list, <strong id="EN-US_TOPIC_0000001233708657__b52269472122926">COPY FROM</strong> will insert the default values for those columns.</li><li id="EN-US_TOPIC_0000001233708657__l339afa5176fa463ab9d2108bed9d59ec">If a source data file is specified, the file must be accessible from the server. If <strong id="EN-US_TOPIC_0000001233708657__b137062531797">STDIN</strong> is specified, data is transmitted between the client and server. Separate columns by pressing <strong id="EN-US_TOPIC_0000001233708657__b970715531899">Tab</strong>. Enter <strong id="EN-US_TOPIC_0000001233708657__b147081753691">\.</strong> in a new line to indicate the end of input.</li><li id="EN-US_TOPIC_0000001233708657__lecd2e963d5a347c58bcdeb59fbe2b675">If the number of columns in a row of the data file is smaller or larger than the expected number, <strong id="EN-US_TOPIC_0000001233708657__b13711482122926">COPY FROM</strong> displays an error message.</li><li id="EN-US_TOPIC_0000001233708657__l852137960d6840cc81e67449ccf7d976">A backslash and a period (\.) indicate the end of data. The end identifier is not required for reading data from a file and is required for copying data between client applications.</li><li id="EN-US_TOPIC_0000001233708657__l61b70bf73cc348ee96043ba2ca62b3d6">In <strong id="EN-US_TOPIC_0000001233708657__b20523811141224">COPY FROM</strong>, "\N" indicates an empty character string, and "\\N" indicates the actual data "\N".</li></ul>
</div>
<ul id="EN-US_TOPIC_0000001233708657__ufd3e26d8790a40028e2fca121893d234"><li id="EN-US_TOPIC_0000001233708657__l449355ed39a24e76aee3f7a80d3a2fac"><strong id="EN-US_TOPIC_0000001233708657__b84235270691756">COPY FROM</strong> does not support pre-processing of data during data import, for example, expression calculation and default value filling. If you need to perform pre-processing during data import, you need to import the data to a temporary table, and then run SQL statements to insert data to the table using expression or function operations. However, this method may cause I/O expansion, deteriorating data import performance.</li><li id="EN-US_TOPIC_0000001233708657__ld3f8301e932b4f1c8e2fd90302aa99ea">Transactions will be rolled back when data format errors occur during <strong id="EN-US_TOPIC_0000001233708657__b84235270692934">COPY FROM</strong> execution. In this case, error information is insufficient so you cannot easily locate the incorrect data from a large amount of raw data.</li><li id="EN-US_TOPIC_0000001233708657__l135af0e15a364782859c53e1adc3252c"><strong id="EN-US_TOPIC_0000001233708657__b84235270693156">COPY FROM</strong> and <strong id="EN-US_TOPIC_0000001233708657__b84235270693225">COPY TO</strong> apply to low concurrency and local data import and export in small amount.</li><li id="EN-US_TOPIC_0000001233708657__li876555714317">You can use <strong id="EN-US_TOPIC_0000001233708657__b845814763917">COPY TO</strong> to export data in TEXT or CSV format to OBS, but cannot use <strong id="EN-US_TOPIC_0000001233708657__b15338115511392">COPY FROM</strong> to import data from OBS. For CSV files that are exported to OBS and contain utf8 BOM, you are advised to use OBS to import them. Otherwise, the BOM field may fail to be identified.</li></ul>
<div class="section" id="EN-US_TOPIC_0000001233708657__s6fbcab66f64b4a3ca5aa9758b4d13189"><h4 class="sectiontitle">Syntax</h4><ul id="EN-US_TOPIC_0000001233708657__u2b8f1073ec4b42949019e7d492995454"><li id="EN-US_TOPIC_0000001233708657__l0e182c4c96b44eddb06ff090ae496bd0">Copy the data from a file to a table:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__s25c1b518d9254284b4a4c1456fa292a7"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="k">table_name</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">column_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">]</span><span class="w"> </span>
<span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="s1">'filename'</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">STDIN</span><span class="w"> </span><span class="err">}</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">USING</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="k">DELIMITERS</span><span class="w"> </span><span class="s1">'delimiters'</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITHOUT</span><span class="w"> </span><span class="n">ESCAPING</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="n">LOG</span><span class="w"> </span><span class="n">ERRORS</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="n">LOG</span><span class="w"> </span><span class="n">ERRORS</span><span class="w"> </span><span class="k">data</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="n">REJECT</span><span class="w"> </span><span class="k">LIMIT</span><span class="w"> </span><span class="s1">'limit'</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">option</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">copy_option</span>
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">FIXED</span><span class="w"> </span><span class="n">FORMATTER</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="k">column_name</span><span class="p">(</span><span class="w"> </span><span class="k">offset</span><span class="p">,</span><span class="w"> </span><span class="k">length</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">option</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">copy_option</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">];</span>
</pre></div></td></tr></table></div>
</div>
<div class="note" id="EN-US_TOPIC_0000001233708657__n81dfb639c9fd4af08e974eeea4d45ee8"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__a7fc07fde00da45c0bf3c79534323fc05">In the SQL syntax, <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b842352706163311_1">FIXED</strong>, <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b842352706163317_1">FORMATTER ( { column_name( offset, length ) } [, ...] )</strong>, and <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b842352706163324_1">[ ( option [, ...] ) | copy_option [ ...] ]</strong> can be in any sequence.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l10be9405c1c44e6d9aa76ff1d8a65c61">Copy the data from a table to a file:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__sb042283a20fd46a6ac8f516bcf47467b"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="k">table_name</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">column_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="s1">'filename'</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">STDOUT</span><span class="w"> </span><span class="err">}</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">USING</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="k">DELIMITERS</span><span class="w"> </span><span class="s1">'delimiters'</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITHOUT</span><span class="w"> </span><span class="n">ESCAPING</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">option</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">copy_option</span>
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">FIXED</span><span class="w"> </span><span class="n">FORMATTER</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="k">column_name</span><span class="p">(</span><span class="w"> </span><span class="k">offset</span><span class="p">,</span><span class="w"> </span><span class="k">length</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">option</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">copy_option</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">];</span>
<span class="k">COPY</span><span class="w"> </span><span class="n">query</span>
<span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="s1">'filename'</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">STDOUT</span><span class="w"> </span><span class="err">}</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITHOUT</span><span class="w"> </span><span class="n">ESCAPING</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">option</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">]</span>
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">copy_option</span>
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">FIXED</span><span class="w"> </span><span class="n">FORMATTER</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="k">column_name</span><span class="p">(</span><span class="w"> </span><span class="k">offset</span><span class="p">,</span><span class="w"> </span><span class="k">length</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">option</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">copy_option</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">];</span>
</pre></div></td></tr></table></div>
</div>
<div class="note" id="EN-US_TOPIC_0000001233708657__n75944ec3d45b49058c70a98229c3ce1f"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ol id="EN-US_TOPIC_0000001233708657__o381157cdb0d84622999f7bf5b29f4fe9"><li id="EN-US_TOPIC_0000001233708657__l5b4ebba2396742a0b0984eb77655897f">The syntax constraints of <strong id="EN-US_TOPIC_0000001233708657__b75750170515458">COPY TO</strong> are as follows:<p id="EN-US_TOPIC_0000001233708657__a69e1e7f0bfbd48978d26bde9699c3fa3"><strong id="EN-US_TOPIC_0000001233708657__b84235270616344">(query)</strong> is incompatible with <strong id="EN-US_TOPIC_0000001233708657__b842352706163412">[USING] DELIMITER</strong>. If the data of <strong id="EN-US_TOPIC_0000001233708657__b842352706163418">COPY TO</strong> comes from a query result, <strong id="EN-US_TOPIC_0000001233708657__b842352706163423">COPY TO</strong> cannot specify <strong id="EN-US_TOPIC_0000001233708657__b842352706163428">[USING] DELIMITERS</strong>.</p>
</li><li id="EN-US_TOPIC_0000001233708657__l98a82990db0a4f9888cf63d93d1bea1e">Use spaces to separate <strong id="EN-US_TOPIC_0000001233708657__b842352706163449">copy_option</strong> following <strong id="EN-US_TOPIC_0000001233708657__b842352706163527">FIXED FORMATTTER</strong>.</li><li id="EN-US_TOPIC_0000001233708657__lfb9e50cc9f0d427f9e078917f6d0c9d9"><strong id="EN-US_TOPIC_0000001233708657__b842352706163536">copy_option</strong> is the native parameter, while <strong id="EN-US_TOPIC_0000001233708657__b84235270616362">option</strong> is the parameter imported by a compatible foreign table.</li><li id="EN-US_TOPIC_0000001233708657__lf54f0f254b3c46be80009168821dee08">In the SQL syntax, <strong id="EN-US_TOPIC_0000001233708657__b1458730453">FIXED</strong>, <strong id="EN-US_TOPIC_0000001233708657__b234420880">FORMATTER ( { column_name( offset, length ) } [, ...] )</strong>, and <strong id="EN-US_TOPIC_0000001233708657__b390977635">[ ( option [, ...] ) | copy_option [ ...] ]</strong> can be in any sequence.</li></ol>
</div></div>
<div class="p" id="EN-US_TOPIC_0000001233708657__p9816315484">The syntax of the optional parameter <strong id="EN-US_TOPIC_0000001233708657__b842352706163650">option</strong> is as follows:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__sb7fda4959ca042b8b3df4317b8825fb5"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span>
<span class="normal">21</span>
<span class="normal">22</span>
<span class="normal">23</span>
<span class="normal">24</span>
<span class="normal">25</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">FORMAT</span><span class="w"> </span><span class="s1">'format_name'</span>
<span class="o">|</span><span class="w"> </span><span class="k">OIDS</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="nb">boolean</span><span class="w"> </span><span class="p">]</span>
<span class="o">|</span><span class="w"> </span><span class="k">DELIMITER</span><span class="w"> </span><span class="s1">'delimiter_character'</span>
<span class="o">|</span><span class="w"> </span><span class="k">NULL</span><span class="w"> </span><span class="s1">'null_string'</span>
<span class="o">|</span><span class="w"> </span><span class="n">HEADER</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="nb">boolean</span><span class="w"> </span><span class="p">]</span>
<span class="o">|</span><span class="w"> </span><span class="n">FILEHEADER</span><span class="w"> </span><span class="s1">'header_file_string'</span>
<span class="o">|</span><span class="w"> </span><span class="k">FREEZE</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="nb">boolean</span><span class="w"> </span><span class="p">]</span>
<span class="o">|</span><span class="w"> </span><span class="n">QUOTE</span><span class="w"> </span><span class="s1">'quote_character'</span>
<span class="o">|</span><span class="w"> </span><span class="k">ESCAPE</span><span class="w"> </span><span class="s1">'escape_character'</span>
<span class="o">|</span><span class="w"> </span><span class="n">EOL</span><span class="w"> </span><span class="s1">'newline_character'</span>
<span class="o">|</span><span class="w"> </span><span class="n">NOESCAPING</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="nb">boolean</span><span class="w"> </span><span class="p">]</span>
<span class="o">|</span><span class="w"> </span><span class="n">FORCE_QUOTE</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">column_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="err">}</span>
<span class="o">|</span><span class="w"> </span><span class="n">FORCE_NOT_NULL</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">column_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span>
<span class="o">|</span><span class="w"> </span><span class="k">ENCODING</span><span class="w"> </span><span class="s1">'encoding_name'</span>
<span class="o">|</span><span class="w"> </span><span class="n">IGNORE_EXTRA_DATA</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="nb">boolean</span><span class="w"> </span><span class="p">]</span>
<span class="o">|</span><span class="w"> </span><span class="n">FILL_MISSING_FIELDS</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="nb">boolean</span><span class="w"> </span><span class="p">]</span>
<span class="o">|</span><span class="w"> </span><span class="n">COMPATIBLE_ILLEGAL_CHARS</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="nb">boolean</span><span class="w"> </span><span class="p">]</span>
<span class="o">|</span><span class="w"> </span><span class="n">DATE_FORMAT</span><span class="w"> </span><span class="s1">'date_format_string'</span>
<span class="o">|</span><span class="w"> </span><span class="n">TIME_FORMAT</span><span class="w"> </span><span class="s1">'time_format_string'</span>
<span class="o">|</span><span class="w"> </span><span class="n">TIMESTAMP_FORMAT</span><span class="w"> </span><span class="s1">'timestamp_format_string'</span>
<span class="o">|</span><span class="w"> </span><span class="n">SMALLDATETIME_FORMAT</span><span class="w"> </span><span class="s1">'smalldatetime_format_string'</span>
<span class="o">|</span><span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="s1">'obs_server_string'</span>
<span class="o">|</span><span class="w"> </span><span class="n">BOM</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="nb">boolean</span><span class="w"> </span><span class="p">]</span>
<span class="o">|</span><span class="w"> </span><span class="n">MAXROW</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">]</span>
<span class="o">|</span><span class="w"> </span><span class="n">FILEPREFIX</span><span class="w"> </span><span class="s1">'file_prefix_string'</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="p" id="EN-US_TOPIC_0000001233708657__p16427156184817">The syntax of optional parameter in the <strong id="EN-US_TOPIC_0000001233708657__b842352706163746">copy_option</strong> is as follows:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__s24878b7e53964db8be8417be6848d2c8"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">OIDS</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="k">NULL</span><span class="w"> </span><span class="s1">'null_string'</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">HEADER</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">FILEHEADER</span><span class="w"> </span><span class="s1">'header_file_string'</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="k">FREEZE</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">FORCE_NOT_NULL</span><span class="w"> </span><span class="k">column_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span>
<span class="o">|</span><span class="w"> </span><span class="n">FORCE_QUOTE</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="k">column_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="err">}</span>
<span class="o">|</span><span class="w"> </span><span class="nb">BINARY</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">CSV</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">QUOTE</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="s1">'quote_character'</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="k">ESCAPE</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="s1">'escape_character'</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">EOL</span><span class="w"> </span><span class="s1">'newline_character'</span>
<span class="o">|</span><span class="w"> </span><span class="k">ENCODING</span><span class="w"> </span><span class="s1">'encoding_name'</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">IGNORE_EXTRA_DATA</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">FILL_MISSING_FIELDS</span>
<span class="o">|</span><span class="w"> </span><span class="n">COMPATIBLE_ILLEGAL_CHARS</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">DATE_FORMAT</span><span class="w"> </span><span class="s1">'date_format_string'</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">TIME_FORMAT</span><span class="w"> </span><span class="s1">'time_format_string'</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">TIMESTAMP_FORMAT</span><span class="w"> </span><span class="s1">'timestamp_format_string'</span><span class="w"> </span>
<span class="o">|</span><span class="w"> </span><span class="n">SMALLDATETIME_FORMAT</span><span class="w"> </span><span class="s1">'smalldatetime_format_string'</span>
</pre></div></td></tr></table></div>
</div>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001233708657__sbc8fc7b73e6b4fc1b1c64ece1fe71c3e"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001233708657__u16891ce476224652aced50f337361555"><li id="EN-US_TOPIC_0000001233708657__l01a0c63b622f4e58aad1f9ff1b805fe6"><strong id="EN-US_TOPIC_0000001233708657__ab1736a9875f3436fb2e81061c60203b9">query</strong><p id="EN-US_TOPIC_0000001233708657__a7d1044b6e9a849b2979131fbb3c45d39">Indicates that the results are to be copied.</p>
<p id="EN-US_TOPIC_0000001233708657__a3bac7f3bf3e04ba186052cb88b5f048f">Value range: a <strong id="EN-US_TOPIC_0000001233708657__b1011483211384">SELECT</strong> or <strong id="EN-US_TOPIC_0000001233708657__b1399504011384">VALUES</strong> command in parentheses</p>
</li><li id="EN-US_TOPIC_0000001233708657__lbf01e6f786494de6a7b3ea89a2c35a1f"><strong id="EN-US_TOPIC_0000001233708657__a8b940b55a7a9482a9205ec5561979042">table_name</strong><p id="EN-US_TOPIC_0000001233708657__a801fd129663143aa9158a8abc8ad988c">Specifies the name (optionally schema-qualified) of an existing table.</p>
<p id="EN-US_TOPIC_0000001233708657__a17cb10b5b0384fa5a079b6d7ea1a61ce">Value range: an existing table name</p>
</li><li id="EN-US_TOPIC_0000001233708657__l5662e15db9c7453cb08c39c6cff127e6"><strong id="EN-US_TOPIC_0000001233708657__a1be29576b9a94efd91275927a9b870e0">column_name</strong><p id="EN-US_TOPIC_0000001233708657__aa96710734128485a91de554ad17676b2">Indicates an optional list of columns to be copied.</p>
<p id="EN-US_TOPIC_0000001233708657__a96c1c8ce5c5e486b8d7a8d67b91f4d31">Value range: If no column list is specified, all columns of the table will be copied.</p>
</li><li id="EN-US_TOPIC_0000001233708657__ld6c5b16a3fe44d188b3ca47f11d14aa9"><strong id="EN-US_TOPIC_0000001233708657__ac5401a4f091d4b5699a8c12b3388c68e">STDIN</strong><p id="EN-US_TOPIC_0000001233708657__ae7882eabe0d346fe9ec9d4e312db1ee8">Indicates that the input comes from the client application.</p>
</li><li id="EN-US_TOPIC_0000001233708657__lc5f4b78d72d345d48a3311e359817448"><strong id="EN-US_TOPIC_0000001233708657__a3bbd6b25d9bd4722ac748d0b59fbc4c6">STDOUT</strong><p id="EN-US_TOPIC_0000001233708657__a300107c710234f02b2585e2f2419dd53">Indicates that output goes to the client application.</p>
</li><li id="EN-US_TOPIC_0000001233708657__l19370f97fd4e45248f1c6370579e81b0"><strong id="EN-US_TOPIC_0000001233708657__ac5e4cf9934a04e04bd2fc59e14b557ea">FIXED</strong><p id="EN-US_TOPIC_0000001233708657__a9c44c87335104a5db48d4c209018f8da">Fixes column length. When the column length is fixed, <strong id="EN-US_TOPIC_0000001233708657__b842352706163953">DELIMITER</strong>, <strong id="EN-US_TOPIC_0000001233708657__b84235270616400">NULL</strong>, and <strong id="EN-US_TOPIC_0000001233708657__b84235270616404">CSV</strong> cannot be specified. When <strong id="EN-US_TOPIC_0000001233708657__b842352706164011">FIXED</strong> is specified, <strong id="EN-US_TOPIC_0000001233708657__b842352706164016">BINARY</strong>, <strong id="EN-US_TOPIC_0000001233708657__b842352706164021">CSV</strong>, and <strong id="EN-US_TOPIC_0000001233708657__b842352706164025">TEXT</strong> cannot be specified by <strong id="EN-US_TOPIC_0000001233708657__b842352706164033">option</strong> or <strong id="EN-US_TOPIC_0000001233708657__b842352706164037">copy_option</strong>.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__n0f65a190133842e38d6a4287291e67b4"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__a50f97a0b01244d988db0069be4a75059">The definition of fixed length:</p>
<ol id="EN-US_TOPIC_0000001233708657__odd1615811d984814a8d57ac802bc3571"><li id="EN-US_TOPIC_0000001233708657__l21f4a799cb8b4f0aaaf01060f4e761ca">The column length of each record is the same.</li><li id="EN-US_TOPIC_0000001233708657__l8a018c3896c344699ae09d4e4a864605">Spaces are added to short columns. Digit type columns must be left-aligned, and character columns must be right-aligned.</li><li id="EN-US_TOPIC_0000001233708657__l9c374f3994214d07a31286b9523770a4">No delimiters are used between columns.</li></ol>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l740d1216053f4f329c3cef78a9b7cbe9"><strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_b191741516451">[USING] DELIMITER 'delimiters'</strong><p id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_p268519516511">The string that separates columns within each row (line) of the file, and it cannot be larger than 10 bytes.</p>
<p id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_p3685855520">Value range: The delimiter cannot include any of the following characters: \.abcdefghijklmnopqrstuvwxyz0123456789</p>
<p id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_p4685651259">Value range: The default value is a tab character in text format and a comma in CSV format.</p>
</li><li id="EN-US_TOPIC_0000001233708657__lf03ea30618b543949c9d63205946f8fd"><strong id="EN-US_TOPIC_0000001233708657__a2e00ff21f55b4cd2baadca9ec95cdedd">WITHOUT ESCAPING</strong><p id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_p16995541163">In TEXT, do not escape a backslash (\) and the characters that follow it.</p>
<p id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_p199951641163">Value range: text only.</p>
</li><li id="EN-US_TOPIC_0000001233708657__li162903912203"><strong id="EN-US_TOPIC_0000001233708657__b154483962017">LOG ERRORS</strong><p id="EN-US_TOPIC_0000001233708657__p20441039102010">If this parameter is specified, the error tolerance mechanism for data type errors in the <strong id="EN-US_TOPIC_0000001233708657__b842352706125925">COPY FROM</strong> statement is enabled. Row errors are recorded in the <strong id="EN-US_TOPIC_0000001233708657__b84235270613013">public.pgxc_copy_error_log</strong> table in the database for future reference.</p>
<p id="EN-US_TOPIC_0000001233708657__p16441139142010">Value range: A value set while data is imported using <strong id="EN-US_TOPIC_0000001233708657__b84235270613044">COPY FROM</strong>.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__note5441539192013"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__p12601239142019">The restrictions of this error tolerance parameter are as follows:</p>
<ul id="EN-US_TOPIC_0000001233708657__ul44335573167"><li id="EN-US_TOPIC_0000001233708657__li106033922016">This error tolerance mechanism captures only the data type errors (DATA_EXCEPTION) that occur during data parsing of <strong id="EN-US_TOPIC_0000001233708657__b2281105471020">COPY FROM</strong> on a CN. Other errors, such as network errors between CNs and DNs or expression conversion errors on DNs, are not captured.</li><li id="EN-US_TOPIC_0000001233708657__li1787012318175">Before enabling error tolerance for <strong id="EN-US_TOPIC_0000001233708657__b84235270613657">COPY FROM</strong> for the first time in a database, check whether the <strong id="EN-US_TOPIC_0000001233708657__b84235270613741">public.pgxc_copy_error_log</strong> table exists. If it does not, call the copy_error_log_create() function to create it. If it does, copy its data elsewhere and call the copy_error_log_create() function to create the table. For details about columns in the <strong id="EN-US_TOPIC_0000001233708657__b816617413612">public.pgxc_copy_error_log</strong> table, see <a href="dws_06_0341.html#EN-US_TOPIC_0000001495991693__table2822639715">Table 3</a>.</li><li id="EN-US_TOPIC_0000001233708657__li287051141720">While a <strong id="EN-US_TOPIC_0000001233708657__b84235270613138">COPY FROM</strong> statement with specified <strong id="EN-US_TOPIC_0000001233708657__b842352706131321">LOG ERRORS</strong> is being executed, if <strong id="EN-US_TOPIC_0000001233708657__b842352706131150">public.pgxc_copy_error_log</strong> does not exist or does not have the table definitions compliant with the predefined in copy_error_log_create(), an error will be reported. Ensure that the error table is created using the copy_error_log_create() function. Otherwise, <strong id="EN-US_TOPIC_0000001233708657__b310867271104053">COPY FROM</strong> statements with error tolerance may fail to be run.</li><li id="EN-US_TOPIC_0000001233708657__li1241701719174">If existing error tolerance parameters (for example, <strong id="EN-US_TOPIC_0000001233708657__b842352706131752">IGNORE_EXTRA_DATA</strong>) of the <strong id="EN-US_TOPIC_0000001233708657__b842352706131755">COPY</strong> statement are enabled, the error of the corresponding type will be processed as specified by the parameters and no error will be reported. Therefore, the error table does not contain such error data.</li><li id="EN-US_TOPIC_0000001233708657__li1675539142014">The coverage scope of this error tolerance mechanism is the same as that of a GDS foreign table. You are advised to filter query results based on table names or the timestamp of marking the start of <strong id="EN-US_TOPIC_0000001233708657__b842352706132028">COPY FROM</strong> statement execution. For details about how to process error data, see the section about handling error tables.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__li153881716267"><strong id="EN-US_TOPIC_0000001233708657__b538161714267">LOG ERRORS DATA</strong><p id="EN-US_TOPIC_0000001233708657__p16951155103018">The differences between <strong id="EN-US_TOPIC_0000001233708657__b12361937153212">LOG ERRORS DATA</strong> and <strong id="EN-US_TOPIC_0000001233708657__b15818124193216">LOG ERRORS</strong> are as follows:</p>
<ol id="EN-US_TOPIC_0000001233708657__ol15607114310526"><li id="EN-US_TOPIC_0000001233708657__li560854315523"><strong id="EN-US_TOPIC_0000001233708657__b1947216522325">LOG ERRORS DATA</strong> fills the <strong id="EN-US_TOPIC_0000001233708657__b5515135903217">rawrecord</strong> field in the error tolerance table.</li><li id="EN-US_TOPIC_0000001233708657__li199024619520">Only users with the super permission can use the <strong id="EN-US_TOPIC_0000001233708657__b966242163316">LOG ERRORS DATA</strong> parameter.<div class="caution" id="EN-US_TOPIC_0000001233708657__note1565131519919"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><p id="EN-US_TOPIC_0000001233708657__p22629199593">If error content is too complex, it may fail to be written to the error tolerance table by using <strong id="EN-US_TOPIC_0000001233708657__b15333640183020">LOG ERRORS DATA</strong>, causing the task failure.</p>
</div></div>
</li></ol>
</li><li id="EN-US_TOPIC_0000001233708657__li17011211807"><strong id="EN-US_TOPIC_0000001233708657__b1540919443400">REJECT LIMIT <strong id="EN-US_TOPIC_0000001233708657__b155977171310">'</strong>limit'</strong><p id="EN-US_TOPIC_0000001233708657__p870619211303">Used with the <strong id="EN-US_TOPIC_0000001233708657__b84235270613222">LOG ERROR</strong> parameter to set the upper limit of the tolerated errors in the <strong id="EN-US_TOPIC_0000001233708657__b842352706132250">COPY FROM</strong> statement. If the number of errors exceeds the limit, later errors will be reported based on the original mechanism.</p>
<p id="EN-US_TOPIC_0000001233708657__p1670852114013">Value range: a positive integer (1 to INTMAX) or <strong id="EN-US_TOPIC_0000001233708657__b842352706132351">unlimited</strong></p>
<p id="EN-US_TOPIC_0000001233708657__p414213351743">Default value: If <strong id="EN-US_TOPIC_0000001233708657__b842352706132455">LOG ERRORS</strong> is not specified, an error will be reported. If <strong id="EN-US_TOPIC_0000001233708657__b842352706132522">LOG ERRORS</strong> is specified, the default value is <strong id="EN-US_TOPIC_0000001233708657__b842352706132531">0</strong>.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__note19362145221020"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__p19371115241018">Different from the GDS error tolerance mechanism, in the error tolerance mechanism described in the description of <strong id="EN-US_TOPIC_0000001233708657__b84235270613264">LOG ERRORS</strong>, the count of <strong id="EN-US_TOPIC_0000001233708657__b842352706132911">REJECT LIMIT</strong> is calculated based on the number of data parsing errors on the CN where the <strong id="EN-US_TOPIC_0000001233708657__b842352706132956">COPY FROM</strong> statement is run, not based on the number of errors on each DN.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l429b7343916949b79b125db3c47223e3"><strong id="EN-US_TOPIC_0000001233708657__ac74c16bb6cf14fd09d8992b29feba0fb">FORMATTER</strong><p id="EN-US_TOPIC_0000001233708657__ac029862abfa948e8adc2952a6658eb73">Defining the location of each column in the data file in fixed length mode. Defining the place of each column in the data file based on column (offset, length) format.</p>
<p id="EN-US_TOPIC_0000001233708657__ac877cf0cbedd412bb70b00f59ad53c2b">Value range:</p>
<ul id="EN-US_TOPIC_0000001233708657__uf4ec5b53925c4ceebf9445864fa36dcb"><li id="EN-US_TOPIC_0000001233708657__lbc804f4ab7f94addbe89ede5cf0bbed4">The value of <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b842352706151114">offset</strong> must be larger than 0. The unit is byte.</li><li id="EN-US_TOPIC_0000001233708657__l6581ae95024940d79c33a6bbe3fc9471">The value of <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b842352706151118">length</strong> must be larger than 0. The unit is byte.</li></ul>
<p id="EN-US_TOPIC_0000001233708657__a9421dd0f442145008b84a36dde34919c">The total length of all columns must be less than 1 GB.</p>
<p id="EN-US_TOPIC_0000001233708657__aa002f8c64d3942e4800f45fd2da4b250">Replace columns that are not in the file with NULL.</p>
</li><li id="EN-US_TOPIC_0000001233708657__l792524d9e2f140d79f238ea0056c4549"><strong id="EN-US_TOPIC_0000001233708657__a9c62dca5696a4adb954298f8e0dea193">OPTION { option_name ' value ' }</strong><p id="EN-US_TOPIC_0000001233708657__a8d0d0165dfcf4e1a83af83feb3487b84">Specifies all types of parameters of a compatible foreign table.</p>
<ul id="EN-US_TOPIC_0000001233708657__u4a709612be7e4c12af7c387366d6692c"><li id="EN-US_TOPIC_0000001233708657__l61d51fbdb28e4eac9676e1544350f2ae">FORMAT<p id="EN-US_TOPIC_0000001233708657__a2c73c8ae21624bf9981672b561a68d00"><a name="EN-US_TOPIC_0000001233708657__l61d51fbdb28e4eac9676e1544350f2ae"></a><a name="l61d51fbdb28e4eac9676e1544350f2ae"></a>Specifies the format of the source data file in the foreign table.</p>
<p id="EN-US_TOPIC_0000001233708657__ad13c12962477411ba56f39dd4652eddc">Value range: CSV, TEXT, FIXED, and BINARY.</p>
<ul id="EN-US_TOPIC_0000001233708657__u97e751d138634765bbe0d18d1590f9b7"><li id="EN-US_TOPIC_0000001233708657__l44280144a97d4d74953c2202e8079fe8">The CSV file can process newline characters efficiently, but cannot process certain special characters well.</li><li id="EN-US_TOPIC_0000001233708657__le400e706a15246b2a5b0aa2a7bd982ab">The TEXT file can process special characters efficiently, but cannot process newline character well.</li><li id="EN-US_TOPIC_0000001233708657__l26c5819284534ad2987afb9337cf453a">The FIXED file can process newline characters in data columns efficiently, but cannot process special characters well.</li><li id="EN-US_TOPIC_0000001233708657__l0fa7319276ee4c0cb99f7e5ae6717e1b">All data in the BINARY file is stored/read as binary format rather than as text. It is faster than the text and CSV formats, but a binary-format file is less portable.</li></ul>
<p id="EN-US_TOPIC_0000001233708657__a7bcf214b279c4ec98e9210f05f5f8be8">Default value: <strong id="EN-US_TOPIC_0000001233708657__b8423527061105">TEXT</strong></p>
</li><li id="EN-US_TOPIC_0000001233708657__l66307742448d40b29886487a3186acfc">OIDS<p id="EN-US_TOPIC_0000001233708657__a073878571a7848ec97b47bf7a792cce0"><a name="EN-US_TOPIC_0000001233708657__l66307742448d40b29886487a3186acfc"></a><a name="l66307742448d40b29886487a3186acfc"></a>Copies the OID for each row.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__nfa4c90d5890f459490ba8fee5dc51baf"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__a396a7556a42340cabf478024fc19f917">An error is raised if OIDs are specified for a table that does not have OIDs, or in the case of copying a query.</p>
</div></div>
<p id="EN-US_TOPIC_0000001233708657__aab44894495ac42a2ab5dd8e1a29c547e">Value range: <strong id="EN-US_TOPIC_0000001233708657__b842352706174916">true</strong>, <strong id="EN-US_TOPIC_0000001233708657__b84235270616240">on</strong>, <strong id="EN-US_TOPIC_0000001233708657__b8423527061633">false</strong>, and <strong id="EN-US_TOPIC_0000001233708657__b842352706174924">off</strong></p>
<p id="EN-US_TOPIC_0000001233708657__ae573528c25ad4aae9006774e94a95bb3">Default value: <strong id="EN-US_TOPIC_0000001233708657__b84235270611018">false</strong></p>
</li><li id="EN-US_TOPIC_0000001233708657__l180d9627b43b4df9baca4ba02d302d80">DELIMITER<div class="p" id="EN-US_TOPIC_0000001233708657__ad9d8cfd09ce045eaafbeccfa55202a8e"><a name="EN-US_TOPIC_0000001233708657__l180d9627b43b4df9baca4ba02d302d80"></a><a name="l180d9627b43b4df9baca4ba02d302d80"></a>Specifies the character that separates columns within each row (line) of the file.<div class="note" id="EN-US_TOPIC_0000001233708657__nddd815a05539414dba062d1eb7aa908a"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233708657__uf444121609e448e09608a06202b9c041"><li id="EN-US_TOPIC_0000001233708657__l6ad4d0af79684830b12e0e49efbc04e6">A delimiter cannot be \r or \n.</li><li id="EN-US_TOPIC_0000001233708657__leffd8acbe214417980039c8d64e52979">A delimiter cannot be the same as null. The delimiter for CSV cannot be same as quote.</li><li id="EN-US_TOPIC_0000001233708657__l5fa804deed3144bf818e420de8b898d6">The delimiter for the TEXT format data cannot contain lowercase letters, digits, or dot (.).</li><li id="EN-US_TOPIC_0000001233708657__l85e9f37fe3ed4043975e7b32afdf1f75">The data length of a single row should be less than 1 GB. If the delimiters are too long and there are too many rows, the length of valid data will be affected.</li><li id="EN-US_TOPIC_0000001233708657__l906ba57ecee84cbda060f34df6c0d1c7">You are advised to use multi-characters and invisible characters for delimiters. For example, you can use multi-characters (such as $^&amp;) and invisible characters (such as 0x07, 0x08, and 0x1b).</li><li id="EN-US_TOPIC_0000001233708657__li1639415351314">For a multi-character delimiter, do not use the same characters, for example, <strong id="EN-US_TOPIC_0000001233708657__b186897444714">---</strong>.</li></ul>
</div></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__a856321e0d1e14ed6bc31e52832bfe8db">Value range: multi-character delimiter within 10 bytes.</p>
<p id="EN-US_TOPIC_0000001233708657__a220a23cb554d47ef80b5baf36ba916dc">Default value:</p>
<ul id="EN-US_TOPIC_0000001233708657__u7ca6fe903ddc49fcaba2eb58cc44e7c1"><li id="EN-US_TOPIC_0000001233708657__l1db044aba3bc45f29f79072cd1395bad">A tab character in TEXT format</li><li id="EN-US_TOPIC_0000001233708657__l7fd346897bad4035be9841cea9d63b1a">A comma (,) in CSV format</li><li id="EN-US_TOPIC_0000001233708657__leb869f09509748fc93ea6b5d90cb3244">No delimiter in FIXED format</li></ul>
</li><li id="EN-US_TOPIC_0000001233708657__lb22246b36069406087d183e5706b2bb3">NULL<p id="EN-US_TOPIC_0000001233708657__a02baac4156e84de8994cd127413fa59e"><a name="EN-US_TOPIC_0000001233708657__lb22246b36069406087d183e5706b2bb3"></a><a name="lb22246b36069406087d183e5706b2bb3"></a>Specifies the string that represents a null value.</p>
<p id="EN-US_TOPIC_0000001233708657__a774b70bd730e415cb30dad82abadf2cb">Value range:</p>
<ul id="EN-US_TOPIC_0000001233708657__ue2cd4bfbb5f44554ba276d492069039a"><li id="EN-US_TOPIC_0000001233708657__l385f38d434da41058a9ba7815cac070c">The null value cannot be <strong id="EN-US_TOPIC_0000001233708657__b842352706105357">\r</strong> or <strong id="EN-US_TOPIC_0000001233708657__b84235270610545">\n</strong>. The maximum length is 100 characters.</li><li id="EN-US_TOPIC_0000001233708657__l73aeda5a14b14acf824780bb24f23e65">The null value cannot be the same as the delimiter or quote parameter.</li></ul>
<p id="EN-US_TOPIC_0000001233708657__ab538be2ab4cc4e05b81dd01a8ada79dd">Default value:</p>
<ul id="EN-US_TOPIC_0000001233708657__uc5fc47edc4a04022a3fd8014922c0e11"><li id="EN-US_TOPIC_0000001233708657__l74846ae7cd3f4fef865f3ca352cf7fe1">An empty string without quotation marks in CSV format</li><li id="EN-US_TOPIC_0000001233708657__lf0fc263149124fb0a285b1300a241c95"><strong id="EN-US_TOPIC_0000001233708657__b8423527061586">\N</strong> in TEXT format</li></ul>
</li><li id="EN-US_TOPIC_0000001233708657__l9facdd1c42604711a217f2b0bebf0f7e">HEADER<p id="EN-US_TOPIC_0000001233708657__a59312d71a2d840949e26b1582526476e"><a name="EN-US_TOPIC_0000001233708657__l9facdd1c42604711a217f2b0bebf0f7e"></a><a name="l9facdd1c42604711a217f2b0bebf0f7e"></a>Specifies whether a file contains a header with the names of each column in the file. header is available only for CSV and FIXED files.</p>
<p id="EN-US_TOPIC_0000001233708657__a05f7826e8caa4822a8995814a2c463e7">When data is imported, if <strong id="EN-US_TOPIC_0000001233708657__b1353543514210">header</strong> is <strong id="EN-US_TOPIC_0000001233708657__b20541335164216">on</strong>, the first row of the data file will be identified as title row and ignored. If header is <strong id="EN-US_TOPIC_0000001233708657__b530603712421">off</strong>, the first row is identified as data.</p>
<p id="EN-US_TOPIC_0000001233708657__a0a74d9d60d794234bfe1662ea2672a43">When data is exported, if <strong id="EN-US_TOPIC_0000001233708657__b7691538184213">header</strong> is <strong id="EN-US_TOPIC_0000001233708657__b46923384425">on</strong>, <strong id="EN-US_TOPIC_0000001233708657__b13692113874210">fileheader</strong> must be specified. If header is <strong id="EN-US_TOPIC_0000001233708657__b1100411425">off</strong>, the exported file does not include a title row.</p>
<p id="EN-US_TOPIC_0000001233708657__a5144b7e1137b49aeb5ae1bc44f71e22a">Value range: true, on, false, and off</p>
<p id="EN-US_TOPIC_0000001233708657__ac61f07e5be00470494c5c165174430a7">Default value: <strong id="EN-US_TOPIC_0000001233708657__b2017450763">false</strong></p>
</li><li id="EN-US_TOPIC_0000001233708657__l7bd2ae37b4f043da870176482053e0a3">QUOTE<p id="EN-US_TOPIC_0000001233708657__a97f2d9f540214c9e9b3ed0cac256128c"><a name="EN-US_TOPIC_0000001233708657__l7bd2ae37b4f043da870176482053e0a3"></a><a name="l7bd2ae37b4f043da870176482053e0a3"></a>Specifies the quote character used when a data value is referenced in a CSV file.</p>
<p id="EN-US_TOPIC_0000001233708657__a9fc45fcd5d6b40108c24c9eb117abc8c">Default value: double quotation mark ("")</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__nbf8ef1ef0b1a4b069732d8483808cf93"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233708657__u7162b8fa2bf64f9ea11f6957a22ca83c"><li id="EN-US_TOPIC_0000001233708657__lcef5a0741ae94ef89b84720a077ebebc">The quote parameter cannot be the same as the delimiter or null parameter.</li><li id="EN-US_TOPIC_0000001233708657__l13b9a703bdb0414d9ee7693c8eb71160">The <strong id="EN-US_TOPIC_0000001233708657__b84235270614567">quote</strong> parameter must be a single one-byte character.</li><li id="EN-US_TOPIC_0000001233708657__lf4e0bc005d254606bfea9ba1cf37e70a">Invisible characters are recommended as <strong id="EN-US_TOPIC_0000001233708657__b193398281611139">quote</strong> values, such as 0x07, 0x08, and 0x1b.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l0849c477de42452dbf449c47de0f5e3a">ESCAPE<p id="EN-US_TOPIC_0000001233708657__a603f66b910934efea59e7208200dc3fb"><a name="EN-US_TOPIC_0000001233708657__l0849c477de42452dbf449c47de0f5e3a"></a><a name="l0849c477de42452dbf449c47de0f5e3a"></a>This option is allowed only when using CSV format. This must be a single one-byte character.</p>
<p id="EN-US_TOPIC_0000001233708657__a417cc5ba1ac84697b3fe08194e615ec4">Default value: the same as the value of QUOTE</p>
</li><li id="EN-US_TOPIC_0000001233708657__li1968610514119">EOL 'newline_character'<p id="EN-US_TOPIC_0000001233708657__p146921450411"><a name="EN-US_TOPIC_0000001233708657__li1968610514119"></a><a name="li1968610514119"></a>Specifies the newline character style of the imported or exported data file.</p>
<p id="EN-US_TOPIC_0000001233708657__p18695175184113">Value range: multi-character newline characters within 10 bytes. Common newline characters include <strong id="EN-US_TOPIC_0000001233708657__b767555554312">\r</strong> (0x0D), <strong id="EN-US_TOPIC_0000001233708657__b094011413443">\n</strong> (0x0A), and <strong id="EN-US_TOPIC_0000001233708657__b18864399442">\r\n</strong> (0x0D0A). Special newline characters include <strong id="EN-US_TOPIC_0000001233708657__b319422144516">$</strong> and <strong id="EN-US_TOPIC_0000001233708657__b590392444518">#</strong>.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__note1244681614431"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233708657__ul344811161432"><li id="EN-US_TOPIC_0000001233708657__li104171424719">The <strong id="EN-US_TOPIC_0000001233708657__b15339948101311">EOL</strong> parameter supports only the TEXT format for data import and export and does not support the CSV or FIXED format for data import. For forward compatibility, the <strong id="EN-US_TOPIC_0000001233708657__b7308105912511">EOL</strong> parameter can be set to <strong id="EN-US_TOPIC_0000001233708657__b437091011615">0x0D</strong> or <strong id="EN-US_TOPIC_0000001233708657__b1537061011618">0x0D0A</strong> for data export in the CSV and FIXED formats.</li><li id="EN-US_TOPIC_0000001233708657__li1145113166433">The value of the <strong id="EN-US_TOPIC_0000001233708657__b1155661525213">EOL</strong> parameter cannot be the same as that of <strong id="EN-US_TOPIC_0000001233708657__b174591434922">DELIMITER</strong> or <strong id="EN-US_TOPIC_0000001233708657__b1769112371525">NULL</strong>.</li><li id="EN-US_TOPIC_0000001233708657__li20456216114313">The <strong id="EN-US_TOPIC_0000001233708657__b440733412464">EOL</strong> parameter value cannot contain lowercase letters, digits, or dot (.).</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__lbf61ee96feda46d694dd09bddb5e5b8b">FORCE_QUOTE { ( column_name [, ...] ) | * }<p id="EN-US_TOPIC_0000001233708657__a10da10f0e4d2454684750255d86dbf5a"><a name="EN-US_TOPIC_0000001233708657__lbf61ee96feda46d694dd09bddb5e5b8b"></a><a name="lbf61ee96feda46d694dd09bddb5e5b8b"></a>Forces quoting to be used for all non-null values in each specified column. This option is allowed only in <strong id="EN-US_TOPIC_0000001233708657__b3895172812155">COPY TO</strong>. <strong id="EN-US_TOPIC_0000001233708657__b16675428914">NULL</strong> values are not quoted.</p>
<p id="EN-US_TOPIC_0000001233708657__a893019e0c1b74d3080c0bd6954167075">Value range: an existing column</p>
</li><li id="EN-US_TOPIC_0000001233708657__l7cf266708c474297ac3f6a85d790e353">FORCE_NOT_NULL ( column_name [, ...] )<p id="EN-US_TOPIC_0000001233708657__a76033febe6c644ca8e4332dd9e977d22"><a name="EN-US_TOPIC_0000001233708657__l7cf266708c474297ac3f6a85d790e353"></a><a name="l7cf266708c474297ac3f6a85d790e353"></a>Does not match the specified columns' values against the null string. This option is allowed only in <strong id="EN-US_TOPIC_0000001233708657__b36008097141224">COPY FROM</strong>, and only when using the CSV format.</p>
<p id="EN-US_TOPIC_0000001233708657__a4dede87cfdf34a75848650cd902e4e59">Value range: an existing column</p>
</li><li id="EN-US_TOPIC_0000001233708657__l1f5756d4b23347b9b1ea9477250ce2a1">ENCODING<p id="EN-US_TOPIC_0000001233708657__a2bf086374f8444d6a2e0141606299189"><a name="EN-US_TOPIC_0000001233708657__l1f5756d4b23347b9b1ea9477250ce2a1"></a><a name="l1f5756d4b23347b9b1ea9477250ce2a1"></a>Specifies that the file is encoded in the <strong id="EN-US_TOPIC_0000001233708657__b8423527061717">encoding_name</strong>. If this option is omitted, the current encoding format is used by default.</p>
</li><li id="EN-US_TOPIC_0000001233708657__lc74350155b224c67ad87ed48f933bf44">IGNORE_EXTRA_DATA<p id="EN-US_TOPIC_0000001233708657__a9292b1d376f347f3ae9a2528740f3201"><a name="EN-US_TOPIC_0000001233708657__lc74350155b224c67ad87ed48f933bf44"></a><a name="lc74350155b224c67ad87ed48f933bf44"></a>When the number of data source files exceeds the number of foreign table columns, whether ignoring excessive columns at the end of the row. This parameter is available only during data importing.</p>
<p id="EN-US_TOPIC_0000001233708657__a4c72f9b91db2424fb27a019d0837230f">Value range: true/on, false/off.</p>
<ul id="EN-US_TOPIC_0000001233708657__ue6e29025b10c422095a237b432fc4cf3"><li id="EN-US_TOPIC_0000001233708657__l36e57a78c3da40c59954752a643249c7">When this parameter is <strong id="EN-US_TOPIC_0000001233708657__b84235270617123">true</strong> or <strong id="EN-US_TOPIC_0000001233708657__b842352706171516">on</strong> and the number of data source files exceeds the number of foreign table columns, excessive columns will be ignored.</li><li id="EN-US_TOPIC_0000001233708657__l8355b1f38ae04a0683915bbc4f299cb8">If the parameter is set to <strong id="EN-US_TOPIC_0000001233708657__b84235270622548">false</strong> or <strong id="EN-US_TOPIC_0000001233708657__b84235270622551">off</strong>, and the number of data source files exceeds the number of foreign table columns, the following error information will be displayed:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__s44c38a5e9f2c420d979a3dc0fcac95b0"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">extra</span><span class="w"> </span><span class="k">data</span><span class="w"> </span><span class="k">after</span><span class="w"> </span><span class="k">last</span><span class="w"> </span><span class="n">expected</span><span class="w"> </span><span class="k">column</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
<p id="EN-US_TOPIC_0000001233708657__a94b2e3330dc846ea84e63e03262a8b16">Default value: <strong id="EN-US_TOPIC_0000001233708657__b1750205122">false</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001233708657__n4163aab99a744819bdf1bb30f86d1911"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001233708657__a2bd4e1f5176043a0965fce414dc5b7fb">If the newline character at the end of the row is lost, setting the parameter to <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058966236_b842352706155739">true</strong> will ignore data in the next row.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l7485c2cfdf4d48f892a7bd89591f013b">COMPATIBLE_ILLEGAL_CHARS<p id="EN-US_TOPIC_0000001233708657__a6c92135904d84f26becc3fc86e9fa677"><a name="EN-US_TOPIC_0000001233708657__l7485c2cfdf4d48f892a7bd89591f013b"></a><a name="l7485c2cfdf4d48f892a7bd89591f013b"></a>Enables or disables fault tolerance on invalid characters during importing. This parameter is available only for <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b84235270617258">COPY FROM</strong>.</p>
<div class="p" id="EN-US_TOPIC_0000001233708657__aaf4ec9bf5e9442639739caab412e0916">Value range: true, on, false, and off<ul id="EN-US_TOPIC_0000001233708657__u2307f6198a8c40988c85f97d61499498"><li id="EN-US_TOPIC_0000001233708657__l84e5053a381848f78d84767b045c7313">When the parameter is <strong id="EN-US_TOPIC_0000001233708657__b842352706164851">true</strong> or <strong id="EN-US_TOPIC_0000001233708657__b84235270617308">on</strong>, invalid characters are tolerated and imported to the database after conversion.</li><li id="EN-US_TOPIC_0000001233708657__l04bcd3758397484e860af5f39751292f">If the parameter is <strong id="EN-US_TOPIC_0000001233708657__b842352706221910">false</strong> or <strong id="EN-US_TOPIC_0000001233708657__b842352706221916">off</strong>, and an error occurs when there are invalid characters, the import will be interrupted.</li></ul>
</div>
<p id="EN-US_TOPIC_0000001233708657__a5fb60cf3d1754e86878057d8ab683e9a">Default value: <strong id="EN-US_TOPIC_0000001233708657__b842352706164830">false</strong> or <strong id="EN-US_TOPIC_0000001233708657__b84235270616558">off</strong></p>
<div class="note" id="EN-US_TOPIC_0000001233708657__n377204782f46438eb2c2ed9084cda66e"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__add3d15e8ea524871983659b3038e334c">The rule of error tolerance when you import invalid characters is as follows:</p>
<p id="EN-US_TOPIC_0000001233708657__aa8f538578a0b400ebd53caad7fe84f99">(1) <strong id="EN-US_TOPIC_0000001233708657__b164511119358">\0</strong> is converted to a space.</p>
<p id="EN-US_TOPIC_0000001233708657__a8e3b26c33aa84f94adcde0f40f63f918">(2) Other invalid characters are converted to question marks.</p>
<p id="EN-US_TOPIC_0000001233708657__ab69909a6ead749a68d9fd46eb148d691">(3) If <strong id="EN-US_TOPIC_0000001233708657__b1010777477222145">compatible_illegal_chars</strong> is set to <strong id="EN-US_TOPIC_0000001233708657__b431150618222145">true</strong> or <strong id="EN-US_TOPIC_0000001233708657__b1393302131222145">on</strong>, invalid characters are tolerated. If <strong id="EN-US_TOPIC_0000001233708657__b1782498801222145">NULL</strong>, <strong id="EN-US_TOPIC_0000001233708657__b1852280373222145">DELIMITER</strong>, <strong id="EN-US_TOPIC_0000001233708657__b1966086235222145">QUOTE</strong>, and <strong id="EN-US_TOPIC_0000001233708657__b1020591894222145">ESCAPE</strong> are set to a spaces or question marks. Errors like "illegal chars conversion may confuse COPY escape 0x20" will be displayed to prompt user to modify parameter values that cause confusion, preventing import errors.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l607e2071eb8f4d03a34836f4cc4027c0">FILL_MISSING_FIELDS<p id="EN-US_TOPIC_0000001233708657__a11bda264e0b7422ea97dcafa31a01523"><a name="EN-US_TOPIC_0000001233708657__l607e2071eb8f4d03a34836f4cc4027c0"></a><a name="l607e2071eb8f4d03a34836f4cc4027c0"></a>Specifies whether to generate an error message when the last column in a row in the source file is lost during data loading.</p>
<div class="p" id="EN-US_TOPIC_0000001233708657__p1153410403389">Value range: <strong id="EN-US_TOPIC_0000001233708657__b51241427203619">true</strong>, <strong id="EN-US_TOPIC_0000001233708657__b1712515274361">on</strong>, <strong id="EN-US_TOPIC_0000001233708657__b312532711369">false</strong>, and <strong id="EN-US_TOPIC_0000001233708657__b15125142719365">off</strong><ul id="EN-US_TOPIC_0000001233708657__ul2535194019385"><li id="EN-US_TOPIC_0000001233708657__li11535140193813">If this parameter is set to <strong id="EN-US_TOPIC_0000001233708657__b13593329103614">true</strong> or <strong id="EN-US_TOPIC_0000001233708657__b115935292362">on</strong> and the last column of a data row in a source data file is lost, the column will be replaced with <strong id="EN-US_TOPIC_0000001233708657__b15941829103611">NULL</strong> and no error message will be generated.</li><li id="EN-US_TOPIC_0000001233708657__li135351440193811">If this parameter is set to <strong id="EN-US_TOPIC_0000001233708657__b770723118367">false</strong> or <strong id="EN-US_TOPIC_0000001233708657__b14707131173614">off</strong> and the last column of a data row in a source data file is lost, the following error information will be displayed:<pre class="screen" id="EN-US_TOPIC_0000001233708657__screen1753594019389">missing data for column "tt"</pre>
</li></ul>
</div>
<p id="EN-US_TOPIC_0000001233708657__p11526179175713">Default value: <strong id="EN-US_TOPIC_0000001233708657__b8712234173617">false</strong> or <strong id="EN-US_TOPIC_0000001233708657__b6712173423620">off</strong></p>
</li><li id="EN-US_TOPIC_0000001233708657__lf3b69ea1e4c14d2380b7e97895e50eaa">DATE_FORMAT<p id="EN-US_TOPIC_0000001233708657__a0353d200b33a40ba993476b7313d788a"><a name="EN-US_TOPIC_0000001233708657__lf3b69ea1e4c14d2380b7e97895e50eaa"></a><a name="lf3b69ea1e4c14d2380b7e97895e50eaa"></a>Imports data of the <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b842352706165232">DATE</strong> type. The BINARY format is not supported. When data of such format is imported, error "cannot specify bulkload compatibility options in BINARY mode" will occur. The parameter is valid only for data importing using the <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b842352706165426_1">COPY FROM</strong> option.</p>
<p id="EN-US_TOPIC_0000001233708657__abedcd73a9ea34ba7bacb4a7e37eb8867">Value range: any valid DATE value. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__n993cbc27668449df9611e2c2c818814e"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__ac0b203cbec9241f88073d4be1b11583f">If ORACLE is specified as the compatible database, the DATE format is TIMESTAMP. For details, see <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b84235270617158">timestamp_format</strong> below.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l5447ea5301af4d9a97d9fa8056c6d427">TIME_FORMAT<p id="EN-US_TOPIC_0000001233708657__a26799fc38cf740baa1e660bde265edbd"><a name="EN-US_TOPIC_0000001233708657__l5447ea5301af4d9a97d9fa8056c6d427"></a><a name="l5447ea5301af4d9a97d9fa8056c6d427"></a>Imports data of the TIME type. The BINARY format is not supported. When data of such format is imported, error "cannot specify bulkload compatibility options in BINARY mode" will occur. The parameter is valid only for data importing using the <strong id="EN-US_TOPIC_0000001233708657__b903849033">COPY FROM</strong> option.</p>
<p id="EN-US_TOPIC_0000001233708657__a3d271192a1b3402d96485b188c446c01">Value range: Valid TIME. Time zones cannot be used. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
</li><li id="EN-US_TOPIC_0000001233708657__lded318c5c64043ae9e865b82a91810be">TIMESTAMP_FORMAT<p id="EN-US_TOPIC_0000001233708657__a657c81403d61431babaaed87dc61a9a0"><a name="EN-US_TOPIC_0000001233708657__lded318c5c64043ae9e865b82a91810be"></a><a name="lded318c5c64043ae9e865b82a91810be"></a>Imports data of the TIMESTAMP type. The BINARY format is not supported. When data of such format is imported, error "cannot specify bulkload compatibility options in BINARY mode" will occur. The parameter is valid only for data importing using the <strong id="EN-US_TOPIC_0000001233708657__b1322258565">COPY FROM</strong> option.</p>
<p id="EN-US_TOPIC_0000001233708657__af35306d7d2ed4813b523c2e2eae45604">Value range: any valid TIMESTAMP value. Time zones are not supported. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
</li><li id="EN-US_TOPIC_0000001233708657__l180f3809d2ee4428903c689c1f637cc3">SMALLDATETIME_FORMAT<p id="EN-US_TOPIC_0000001233708657__afd6a97d6f89944f5959ff1908ea2b1b8"><a name="EN-US_TOPIC_0000001233708657__l180f3809d2ee4428903c689c1f637cc3"></a><a name="l180f3809d2ee4428903c689c1f637cc3"></a>Imports data of the SMALLDATETIME type. The BINARY format is not supported. When data of such format is imported, error "cannot specify bulkload compatibility options in BINARY mode" will occur. The parameter is valid only for data importing using the <strong id="EN-US_TOPIC_0000001233708657__b542676732">COPY FROM</strong> option.</p>
<p id="EN-US_TOPIC_0000001233708657__a8e0315c705f54c67a6588c424c893914">Value range: any valid SMALLDATETIME value. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
</li><li id="EN-US_TOPIC_0000001233708657__li109811951979">SERVER<p id="EN-US_TOPIC_0000001233708657__p29815511718"><a name="EN-US_TOPIC_0000001233708657__li109811951979"></a><a name="li109811951979"></a>Specifies the OBS server. <strong id="EN-US_TOPIC_0000001233708657__b178693235219">filename</strong> is a path on OBS, indicating that data is exported to OBS.</p>
<p id="EN-US_TOPIC_0000001233708657__p198185371">Value range: an existing OBS server name.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__note1698119518714"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__p39817514710">This parameter is valid only for <strong id="EN-US_TOPIC_0000001233708657__b581472415529">COPY TO</strong>.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__li179811555710">BOM<p id="EN-US_TOPIC_0000001233708657__p098211517716"><a name="EN-US_TOPIC_0000001233708657__li179811555710"></a><a name="li179811555710"></a>Specifies whether to add the utf8 BOM field to the exported CSV file.</p>
<p id="EN-US_TOPIC_0000001233708657__p79821517713">Value range: <strong id="EN-US_TOPIC_0000001233708657__b1751591165312">true</strong>, <strong id="EN-US_TOPIC_0000001233708657__b252181115310">on</strong>, <strong id="EN-US_TOPIC_0000001233708657__b13521151115316">false</strong>, and <strong id="EN-US_TOPIC_0000001233708657__b1852214111533">off</strong></p>
<p id="EN-US_TOPIC_0000001233708657__p13982152713">Default value: <strong id="EN-US_TOPIC_0000001233708657__b1738113105311">false</strong></p>
<div class="note" id="EN-US_TOPIC_0000001233708657__note1198215978"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__p79824514710">This parameter is valid only when <strong id="EN-US_TOPIC_0000001233708657__b125921222145610">COPY TO</strong> is executed and a valid SERVER is specified. The exported file must be encoded in UTF-8 format.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__li59821655715">MAXROW<p id="EN-US_TOPIC_0000001233708657__p1098220515717"><a name="EN-US_TOPIC_0000001233708657__li59821655715"></a><a name="li59821655715"></a>Maximum number of lines in an exported file. If the number of lines in an exported file exceeds this value, a new file is generated.</p>
<p id="EN-US_TOPIC_0000001233708657__p159821354711">The value ranges from <strong id="EN-US_TOPIC_0000001233708657__b3329101616572">1</strong> to <strong id="EN-US_TOPIC_0000001233708657__b432913162572">2147483647</strong>.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__note7982451718"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__p7982451475">This parameter is valid only when<strong id="EN-US_TOPIC_0000001233708657__b1412334011575"> COPY TO</strong> is executed and a valid SERVER is specified. When <strong id="EN-US_TOPIC_0000001233708657__b1452175645718">HEADER</strong> is set to <strong id="EN-US_TOPIC_0000001233708657__b1878971155818">true</strong>, <strong id="EN-US_TOPIC_0000001233708657__b111201155588">MAXROW</strong> must be greater than 1. This parameter must be specified together with <strong id="EN-US_TOPIC_0000001233708657__b53643129584">FILEPREFIX</strong>.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__li6982651973">FILEPREFIX<p id="EN-US_TOPIC_0000001233708657__p1982454712"><a name="EN-US_TOPIC_0000001233708657__li6982651973"></a><a name="li6982651973"></a>Specifies the prefix of an export file name.</p>
<p id="EN-US_TOPIC_0000001233708657__p7982651275">Value range: a valid string that cannot start or end with a slash (/)</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__note8982551176"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__p3982852710">This parameter is valid only when<strong id="EN-US_TOPIC_0000001233708657__b6812182495819"> COPY TO</strong> is executed and a valid SERVER is specified. This parameter must be specified together with <strong id="EN-US_TOPIC_0000001233708657__b245735114576">MAXROW</strong>.</p>
</div></div>
</li></ul>
</li><li id="EN-US_TOPIC_0000001233708657__l383ae04d25b745e097dc3cdbfef30dea"><strong id="EN-US_TOPIC_0000001233708657__a06b66e56d4ad4c439a7f2efaafbc984e">COPY_OPTION { option_name ' value ' }</strong><p id="EN-US_TOPIC_0000001233708657__a0197cb53471848a79fe997a456fd5307">Specifies all types of native parameters of <strong id="EN-US_TOPIC_0000001233708657__b84235270616417">COPY</strong>.</p>
<ul id="EN-US_TOPIC_0000001233708657__u4caddef7b2e74fa2821f962dc6bf4084"><li id="EN-US_TOPIC_0000001233708657__l5bcd592aadc741978c1bc99eb4947fc0">OIDS<div class="p" id="EN-US_TOPIC_0000001233708657__a1b38412f11ae4199bc2b37469be67c43"><a name="EN-US_TOPIC_0000001233708657__l5bcd592aadc741978c1bc99eb4947fc0"></a><a name="l5bcd592aadc741978c1bc99eb4947fc0"></a>Copies the OID for each row.<div class="note" id="EN-US_TOPIC_0000001233708657__n36ff3297bd9641d1bd85f0a6be4e0294"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__a8b7ba3298a37421f8fd66f555bb2a89d">An error is raised if OIDs are specified for a table that does not have OIDs, or in the case of copying a query.</p>
</div></div>
</div>
</li><li id="EN-US_TOPIC_0000001233708657__le91e93362bb04324b4d4f8b0a27f9391">NULL null_string<div class="p" id="EN-US_TOPIC_0000001233708657__a3e9ec2e5aa9c45f9806017fa2b1abe08"><a name="EN-US_TOPIC_0000001233708657__le91e93362bb04324b4d4f8b0a27f9391"></a><a name="le91e93362bb04324b4d4f8b0a27f9391"></a>Specifies the string that represents a null value.<div class="notice" id="EN-US_TOPIC_0000001233708657__n54061e9e11be416086fec8669bf394e2"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001233708657__a8999cd6e8f954dce91fd1b519923c5f4">When using <strong id="EN-US_TOPIC_0000001233708657__b5326663141224">COPY FROM</strong>, any data item that matches this string will be stored as a <strong id="EN-US_TOPIC_0000001233708657__b6115181391010">NULL</strong> value, so you should make sure that you use the same string as you used with <strong id="EN-US_TOPIC_0000001233708657__b47939968141224">COPY TO</strong>.</p>
</div></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__a262ae3300de6483e81b88c0ce9f81d6d">Value range:</p>
<ul id="EN-US_TOPIC_0000001233708657__u3894fd5ae5bf4e50803a044295c67cc3"><li id="EN-US_TOPIC_0000001233708657__l6666c8932596448cbc5e19c772e47e23">The null value cannot be <strong id="EN-US_TOPIC_0000001233708657__b179239354">\r</strong> or <strong id="EN-US_TOPIC_0000001233708657__b191194644">\n</strong>. The maximum length is 100 characters.</li><li id="EN-US_TOPIC_0000001233708657__lfed8eea86a00443aa8415495ad81b013">The null value cannot be the same as the delimiter or quote parameter.</li></ul>
<p id="EN-US_TOPIC_0000001233708657__afe12e8a8bc864b15a725e5ad154b2b8f">Default value:</p>
<ul id="EN-US_TOPIC_0000001233708657__uf5ec995a056849a9a1894f6f04e671c9"><li id="EN-US_TOPIC_0000001233708657__leb230cd94ace46909b3eab6779f3f773"><strong id="EN-US_TOPIC_0000001233708657__b1921622132">\N</strong> in TEXT format</li><li id="EN-US_TOPIC_0000001233708657__lf77644b3db4040b38a7807f7f11ead16">An empty string without quotation marks in CSV format</li></ul>
</li><li id="EN-US_TOPIC_0000001233708657__lfe223eff4acc42d9bbf40328db5e5b64">HEADER<p id="EN-US_TOPIC_0000001233708657__ae01d8878b4b1409e84b49025e9bafcf9"><a name="EN-US_TOPIC_0000001233708657__lfe223eff4acc42d9bbf40328db5e5b64"></a><a name="lfe223eff4acc42d9bbf40328db5e5b64"></a>Specifies whether a file contains a header with the names of each column in the file. header is available only for CSV and FIXED files.</p>
<p id="EN-US_TOPIC_0000001233708657__a925ea9198be54338984e15db77aa2d25">When data is imported, if <strong id="EN-US_TOPIC_0000001233708657__b632964654220">header</strong> is <strong id="EN-US_TOPIC_0000001233708657__b83341146194211">on</strong>, the first row of the data file will be identified as title row and ignored. If header is <strong id="EN-US_TOPIC_0000001233708657__b13545104718428">off</strong>, the first row is identified as data.</p>
<p id="EN-US_TOPIC_0000001233708657__a518a4432bc504eafbc0a50cbbbb88c2a">When data is exported, if <strong id="EN-US_TOPIC_0000001233708657__b663114964211">header</strong> is <strong id="EN-US_TOPIC_0000001233708657__b19631549114219">on</strong>, <strong id="EN-US_TOPIC_0000001233708657__b064349124216">fileheader</strong> must be specified. If header is <strong id="EN-US_TOPIC_0000001233708657__b739312505424">off</strong>, the exported file does not include a title row.</p>
</li><li id="EN-US_TOPIC_0000001233708657__l1adff63745fb44949d85dd6b0c4d85aa">FILEHEADER<p id="EN-US_TOPIC_0000001233708657__a727f5ac61250409c8c0e77d752c2e9d0"><a name="EN-US_TOPIC_0000001233708657__l1adff63745fb44949d85dd6b0c4d85aa"></a><a name="l1adff63745fb44949d85dd6b0c4d85aa"></a>Specifies a file that defines the content in the header for exported data. The file contains data description of each column.</p>
<div class="notice" id="EN-US_TOPIC_0000001233708657__nad90d360e0ae4a408ffc2cb7fbac44fc"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001233708657__uc0afb1d0e80041f2924dede3a87607cc"><li id="EN-US_TOPIC_0000001233708657__leefb3a5bef5b460f94dd3ca9426f4135">This parameter is available only when <strong id="EN-US_TOPIC_0000001233708657__b329055310112">header</strong> is <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b842352706164910">on</strong> or <strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0058965600_b842352706164915">true</strong>.</li><li id="EN-US_TOPIC_0000001233708657__lee0b3eb662c442ee88ed871bc892615b"><strong id="EN-US_TOPIC_0000001233708657__b842352706173937">fileheader</strong> specifies an absolute path.</li><li id="EN-US_TOPIC_0000001233708657__l2d9d6250f1594bc2803319b827968a35">The file can contain only one row of header information, and ends with a linefeed. Excess rows will be discarded. (Header information cannot contain linefeeds.)</li><li id="EN-US_TOPIC_0000001233708657__l6f3be7955068410b9897a9c6b3859429">The length of the file including the linefeed cannot exceed 1 MB.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__la254a9f6fba14cd5b67713f6aeca64f8">FREEZE<p id="EN-US_TOPIC_0000001233708657__a5edc84d2f02f434b93c054db4e00961b"><a name="EN-US_TOPIC_0000001233708657__la254a9f6fba14cd5b67713f6aeca64f8"></a><a name="la254a9f6fba14cd5b67713f6aeca64f8"></a>Sets the <strong id="EN-US_TOPIC_0000001233708657__b842352706164937">COPY</strong> loaded data row as <strong id="EN-US_TOPIC_0000001233708657__b842352706151447">frozen</strong>, like these data have executed <strong id="EN-US_TOPIC_0000001233708657__b842352706164945">VACUUM FREEZE</strong>.</p>
<p id="EN-US_TOPIC_0000001233708657__a94f37bd655cf4145a02a785e131155a3">This is a performance option of initial data loading. The data will be frozen only when the following three requirements are met:</p>
<ul id="EN-US_TOPIC_0000001233708657__u5185e593a88845cfa11c6e66b7829c5f"><li id="EN-US_TOPIC_0000001233708657__lc6e00ee8a86d4c0cbcd150b7f235ae5b">The table being loaded has been created or truncated in the current subtransaction before copying.</li><li id="EN-US_TOPIC_0000001233708657__la848ab450a514f20b378ada1cc362974">There are no cursors open in the current transaction.</li><li id="EN-US_TOPIC_0000001233708657__l711269b547044f45bc2a70f3fa7b4c55">There are no original snapshots in the current transaction.</li></ul>
<div class="note" id="EN-US_TOPIC_0000001233708657__nfc312563205544bfbee339688dea43c8"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__a2e090d3a9b0e4e32a482fc52dfd2670d">When <strong id="EN-US_TOPIC_0000001233708657__b842352706165049">COPY</strong> is completed, all the other sessions will see the data immediately. This violates the normal rules of MVCC visibility and users should be aware of the potential problems this might cause.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__leacecdb841cc4b6f957c656f9878e5e1">FORCE NOT NULL column_name [, ...]<p id="EN-US_TOPIC_0000001233708657__a06fccdd65ae442c890ca4034c0ac6025"><a name="EN-US_TOPIC_0000001233708657__leacecdb841cc4b6f957c656f9878e5e1"></a><a name="leacecdb841cc4b6f957c656f9878e5e1"></a>Does not match the specified columns' values against the null string. This option is allowed only in <strong id="EN-US_TOPIC_0000001233708657__b1349654514">COPY FROM</strong>, and only when using the CSV format.</p>
<p id="EN-US_TOPIC_0000001233708657__ab25112f835ee47c1871c3b94f8b3e1a3">Value range: an existing column</p>
</li><li id="EN-US_TOPIC_0000001233708657__ld1b7eb928ed646bcaa1015c5358789e7">FORCE QUOTE { column_name [, ...] | * }<p id="EN-US_TOPIC_0000001233708657__a2ef2d6029cc94f29a6183579597a94cf"><a name="EN-US_TOPIC_0000001233708657__ld1b7eb928ed646bcaa1015c5358789e7"></a><a name="ld1b7eb928ed646bcaa1015c5358789e7"></a>Forces quoting to be used for all non-NULL values in each specified column. This option is allowed only in <strong id="EN-US_TOPIC_0000001233708657__b38794595933647">COPY TO</strong>, and only when using the CSV format. <strong id="EN-US_TOPIC_0000001233708657__b2110187025">NULL</strong> values are not quoted.</p>
<p id="EN-US_TOPIC_0000001233708657__aa094ce62c3914241a52e1bbea9d2ac11">Value range: an existing column</p>
</li><li id="EN-US_TOPIC_0000001233708657__l5f336fdd7aeb4b44a28d3727fad5f98b">BINARY<p id="EN-US_TOPIC_0000001233708657__ae774b2630b094cff9d2a0d66b844a18b"><a name="EN-US_TOPIC_0000001233708657__l5f336fdd7aeb4b44a28d3727fad5f98b"></a><a name="l5f336fdd7aeb4b44a28d3727fad5f98b"></a>The binary format option causes all data to be stored/read as binary format rather than as text. In binary mode, you cannot declare <strong id="EN-US_TOPIC_0000001233708657__b193131551433647">DELIMITER</strong>, <strong id="EN-US_TOPIC_0000001233708657__b84812874633647">NULL</strong>, or <strong id="EN-US_TOPIC_0000001233708657__b93586744633647">CSV</strong>. After specifying BINARY, CSV, FIXED and TEXT cannot be specified through <strong id="EN-US_TOPIC_0000001233708657__b842352706151632">option</strong> or <strong id="EN-US_TOPIC_0000001233708657__b842352706151637">copy_option</strong>.</p>
</li><li id="EN-US_TOPIC_0000001233708657__l00a73d142e87422485b356cca74199d8">CSV<p id="EN-US_TOPIC_0000001233708657__abf335abee1794a7095053660f8d8c219"><a name="EN-US_TOPIC_0000001233708657__l00a73d142e87422485b356cca74199d8"></a><a name="l00a73d142e87422485b356cca74199d8"></a>Enables the CSV mode. After CSV is specified, <strong id="EN-US_TOPIC_0000001233708657__b1644495213420">BINARY</strong>, <strong id="EN-US_TOPIC_0000001233708657__b1744425212421">FIXED</strong> and <strong id="EN-US_TOPIC_0000001233708657__b744510522427">TEXT</strong> cannot be specified through <strong id="EN-US_TOPIC_0000001233708657__b11445205212427">option</strong> or <strong id="EN-US_TOPIC_0000001233708657__b104460521424">copy_option</strong>.</p>
</li><li id="EN-US_TOPIC_0000001233708657__lf17b9852cc6d42748bcfb38a1e57871a">QUOTE [AS] 'quote_character'<p id="EN-US_TOPIC_0000001233708657__a1162c487efaf4200af68147125d73a00"><a name="EN-US_TOPIC_0000001233708657__lf17b9852cc6d42748bcfb38a1e57871a"></a><a name="lf17b9852cc6d42748bcfb38a1e57871a"></a>Specifies the quote character for a CSV file.</p>
<p id="EN-US_TOPIC_0000001233708657__aa4816a27cbea476689ab91810183cd19">Default value: double quotation mark ("")</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__nb7e99798f52c4d4c8829b4cc1f61e3ae"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233708657__ua26b456e773a48d986753140d05b81ad"><li id="EN-US_TOPIC_0000001233708657__l9400e3d08c5b4f1992992ddcc9563843">The quote parameter cannot be the same as the delimiter or null parameter.</li><li id="EN-US_TOPIC_0000001233708657__l77fc36abf1a14abc982e15af3aa3375f">The <strong id="EN-US_TOPIC_0000001233708657__b724356472">quote</strong> parameter must be a single one-byte character.</li><li id="EN-US_TOPIC_0000001233708657__lfeac0fe2f1054c8f8bed1600183a68ed">Invisible characters are recommended as <strong id="EN-US_TOPIC_0000001233708657__b398945414424">quote</strong> values, such as 0x07, 0x08, and 0x1b.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l876f3ae8210d4a47acf80ecec26d7f26">ESCAPE [AS] 'escape_character'<p id="EN-US_TOPIC_0000001233708657__aacce4fba4bbf44b795b2be44dccc2c25"><a name="EN-US_TOPIC_0000001233708657__l876f3ae8210d4a47acf80ecec26d7f26"></a><a name="l876f3ae8210d4a47acf80ecec26d7f26"></a>This option is allowed only when using CSV format. This must be a single one-byte character.</p>
<p id="EN-US_TOPIC_0000001233708657__a3710ca07eb7748d5b88ded3edebbfb77">The default value is a double quotation mark ("). If it is the same as the value of <strong id="EN-US_TOPIC_0000001233708657__b593135994218">quote</strong>, it will be replaced with <strong id="EN-US_TOPIC_0000001233708657__b17936135964218">\0</strong>.</p>
</li><li id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778310_li62201592">EOL 'newline_character'<p id="EN-US_TOPIC_0000001233708657__ac972f10899ca443c8019167639eb78ea"><a name="EN-US_TOPIC_0000001233708657__en-us_topic_0059778310_li62201592"></a><a name="en-us_topic_0059778310_li62201592"></a>Specifies the newline character style of the imported or exported data file.</p>
<p id="EN-US_TOPIC_0000001233708657__a1b0c62fd2c5b48c8846081c1cc472715">Value range: multi-character newline characters within 10 bytes. Common newline characters include <strong id="EN-US_TOPIC_0000001233708657__b1999220131494">\r</strong> (0x0D), <strong id="EN-US_TOPIC_0000001233708657__b179921131194">\n</strong> (0x0A), and <strong id="EN-US_TOPIC_0000001233708657__b7992813894">\r\n</strong> (0x0D0A). Special newline characters include <strong id="EN-US_TOPIC_0000001233708657__b159935134910">$</strong> and <strong id="EN-US_TOPIC_0000001233708657__b69931213894">#</strong>.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__note12161826171812"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233708657__ul6618163951815"><li id="EN-US_TOPIC_0000001233708657__li8618183911182">The <strong id="EN-US_TOPIC_0000001233708657__b8779136195211">EOL</strong> parameter supports only the TEXT format for data import and export. For forward compatibility, the <strong id="EN-US_TOPIC_0000001233708657__b1914290043">EOL</strong> parameter can be set to <strong id="EN-US_TOPIC_0000001233708657__b93495128">0x0D</strong> or <strong id="EN-US_TOPIC_0000001233708657__b1272408167">0x0D0A</strong> for data export in the CSV and FIXED formats.</li><li id="EN-US_TOPIC_0000001233708657__li7618173914189">The value of the <strong id="EN-US_TOPIC_0000001233708657__b13765953195218">EOL</strong> parameter cannot be the same as that of <strong id="EN-US_TOPIC_0000001233708657__b780216376">DELIMITER</strong> or <strong id="EN-US_TOPIC_0000001233708657__b1980216772">NULL</strong>.</li><li id="EN-US_TOPIC_0000001233708657__li14277205861815">The <strong id="EN-US_TOPIC_0000001233708657__b1596565774613">EOL</strong> parameter value cannot contain lowercase letters, digits, or dot (.).</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l94a03a74559148c69d8fbc3d57315c94">ENCODING 'encoding_name'<p id="EN-US_TOPIC_0000001233708657__af2c32c0e31ef4102a5a25a4efadc0cc2"><a name="EN-US_TOPIC_0000001233708657__l94a03a74559148c69d8fbc3d57315c94"></a><a name="l94a03a74559148c69d8fbc3d57315c94"></a>Specifies that the file is encoded in the <strong id="EN-US_TOPIC_0000001233708657__b1215416318439">encoding_name</strong>.</p>
<p id="EN-US_TOPIC_0000001233708657__p13715162434419">Value range: a valid encoding format</p>
<p id="EN-US_TOPIC_0000001233708657__a4a99e83cdd97429a8c6b6d12949d6be4">Default value: current encoding format of the database</p>
</li><li id="EN-US_TOPIC_0000001233708657__lc0b7fb2557cc4213bd7c983d9709aab4">IGNORE_EXTRA_DATA<p id="EN-US_TOPIC_0000001233708657__a2fd2cf67569f4d0a8047a5bb1db8aa46"><a name="EN-US_TOPIC_0000001233708657__lc0b7fb2557cc4213bd7c983d9709aab4"></a><a name="lc0b7fb2557cc4213bd7c983d9709aab4"></a>When the number of data source files exceeds the number of foreign table columns, excess columns at the end of the row are ignored. This parameter is available only during data importing.</p>
<div class="p" id="EN-US_TOPIC_0000001233708657__a50cffe8ab47743209d6b2a1b84f2aa73">If you do not use this parameter, and the number of data source files exceeds the number of foreign table columns, the following error information will be displayed:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__s3ee3345d6b1b465090ff90eb84081225"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">extra</span><span class="w"> </span><span class="k">data</span><span class="w"> </span><span class="k">after</span><span class="w"> </span><span class="k">last</span><span class="w"> </span><span class="n">expected</span><span class="w"> </span><span class="k">column</span>
</pre></div></td></tr></table></div>
</div>
</div>
</li><li id="EN-US_TOPIC_0000001233708657__l6d6845dca537479fb5b662a7a1b8671e">COMPATIBLE_ILLEGAL_CHARS<p id="EN-US_TOPIC_0000001233708657__a0a0ef72c9f374f52bb37c4c9679b8114"><a name="EN-US_TOPIC_0000001233708657__l6d6845dca537479fb5b662a7a1b8671e"></a><a name="l6d6845dca537479fb5b662a7a1b8671e"></a>Specifies error tolerance for invalid characters during importing. Invalid characters are converted before importing. No error message is displayed. The import is not interrupted. The BINARY format is not supported. When data of such format is imported, error "cannot specify bulkload compatibility options in BINARY mode" will occur. The parameter is valid only for data importing using the <strong id="EN-US_TOPIC_0000001233708657__b1340344416">COPY FROM</strong> option.</p>
<p id="EN-US_TOPIC_0000001233708657__aaccdfa50867c4d448a9c24d14150746c">If you do not use this parameter, an error occurs when there is an invalid character, and the import stops.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__n0186868d5753446da4222cfca6ac375b"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__a56b55ba593634ed0a116fb6f14a646b5">The rule of error tolerance when you import invalid characters is as follows:</p>
<ol id="EN-US_TOPIC_0000001233708657__ol0602188142311"><li id="EN-US_TOPIC_0000001233708657__li660298142316"><strong id="EN-US_TOPIC_0000001233708657__b154473983222157">\0</strong> is converted to a space.</li><li id="EN-US_TOPIC_0000001233708657__li060238182312">Other illegal characters are converted to question marks.</li><li id="EN-US_TOPIC_0000001233708657__li760216812319">Setting <strong id="EN-US_TOPIC_0000001233708657__b4572346193613">compatible_illegal_chars</strong> to <strong id="EN-US_TOPIC_0000001233708657__b1857216468367">true/on</strong> enables toleration of invalid characters. If <strong id="EN-US_TOPIC_0000001233708657__b1572194611367">NULL</strong>, <strong id="EN-US_TOPIC_0000001233708657__b115738462366">DELIMITER</strong>, <strong id="EN-US_TOPIC_0000001233708657__b14573746183611">QUOTE</strong>, and <strong id="EN-US_TOPIC_0000001233708657__b145731946173611">ESCAPE</strong> are set to spaces or question marks, errors like "illegal chars conversion may confuse COPY escape 0x20" will be displayed to prompt the user to modify parameters that may cause confusion, preventing importing errors.</li></ol>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__li6114916467">FILL_MISSING_FIELDS<p id="EN-US_TOPIC_0000001233708657__p1711169144618"><a name="EN-US_TOPIC_0000001233708657__li6114916467"></a><a name="li6114916467"></a>Specifies whether to generate an error message when the last column in a row in the source file is lost during data loading.</p>
<div class="p" id="EN-US_TOPIC_0000001233708657__p82518281402">Value range: <strong id="EN-US_TOPIC_0000001233708657__b17344614375">true</strong>, <strong id="EN-US_TOPIC_0000001233708657__b12344613374">on</strong>, <strong id="EN-US_TOPIC_0000001233708657__b17345643712">false</strong>, and <strong id="EN-US_TOPIC_0000001233708657__b435466378">off</strong><ul id="EN-US_TOPIC_0000001233708657__ul225828184019"><li id="EN-US_TOPIC_0000001233708657__li9261428174015">If this parameter is set to <strong id="EN-US_TOPIC_0000001233708657__b163142819379">true</strong> or <strong id="EN-US_TOPIC_0000001233708657__b1231513815379">on</strong> and the last column of a data row in a source data file is lost, the column will be replaced with <strong id="EN-US_TOPIC_0000001233708657__b031568113711">NULL</strong> and no error message will be generated.</li><li id="EN-US_TOPIC_0000001233708657__li726428104012">If this parameter is set to <strong id="EN-US_TOPIC_0000001233708657__b398699143718">false</strong> or <strong id="EN-US_TOPIC_0000001233708657__b1398739123714">off</strong> and the last column of a data row in a source data file is lost, the following error information will be displayed:<pre class="screen" id="EN-US_TOPIC_0000001233708657__screen1261228104018">missing data for column "tt"</pre>
</li></ul>
</div>
<p id="EN-US_TOPIC_0000001233708657__p9299054185813">Default value: <strong id="EN-US_TOPIC_0000001233708657__b16154111333710">false</strong> or <strong id="EN-US_TOPIC_0000001233708657__b101541213163714">off</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001233708657__note11189164619"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001233708657__p02617914461">Do not specify this option. Currently, it does not enable error tolerance, but will make the parser ignore the said errors during data parsing on the CN. Such errors will not be recorded in the COPY error table (enabled using <strong id="EN-US_TOPIC_0000001233708657__b462644713355">LOG ERRORS REJECT LIMIT</strong>) but will be reported later by DNs.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__ld74578092201479f8505106ee43476b9">DATE_FORMAT 'date_format_string'<p id="EN-US_TOPIC_0000001233708657__a3ab21b07ef0b43d88bfff3e199fe4ee7"><a name="EN-US_TOPIC_0000001233708657__ld74578092201479f8505106ee43476b9"></a><a name="ld74578092201479f8505106ee43476b9"></a>Imports data of the DATE type. The BINARY format is not supported. When data of such format is imported, error "cannot specify bulkload compatibility options in BINARY mode" will occur. The parameter is valid only for data importing using the <strong id="EN-US_TOPIC_0000001233708657__b1949289541">COPY FROM</strong> option.</p>
<p id="EN-US_TOPIC_0000001233708657__ac8c74489c7964d0881c943a4fd88239e">Value range: any valid DATE value. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
<div class="note" id="EN-US_TOPIC_0000001233708657__nf3a4bf79cf784b08be964195d863bc7f"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233708657__a973b437508c54adf8a0a99b0935f1b0c">If ORACLE is specified as the compatible database, the DATE format is TIMESTAMP. For details, see <strong id="EN-US_TOPIC_0000001233708657__b1184110617434">timestamp_format</strong> below.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001233708657__l0086b6ab5aad4ce8884d32e6cc50c7a2">TIME_FORMAT 'time_format_string'<p id="EN-US_TOPIC_0000001233708657__a7d95c5461e224da395643e792a9d6832"><a name="EN-US_TOPIC_0000001233708657__l0086b6ab5aad4ce8884d32e6cc50c7a2"></a><a name="l0086b6ab5aad4ce8884d32e6cc50c7a2"></a>Imports data of the TIME type. The BINARY format is not supported. When data of such format is imported, error "cannot specify bulkload compatibility options in BINARY mode" will occur. The parameter is valid only for data importing using the <strong id="EN-US_TOPIC_0000001233708657__b550678355">COPY FROM</strong> option.</p>
<p id="EN-US_TOPIC_0000001233708657__ac5aea98cb5b941e9bfb5b119c5cfa486">Value range: Valid TIME. Time zones cannot be used. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
</li><li id="EN-US_TOPIC_0000001233708657__ladbe486adea543a4bb7a9c11202fb68c">TIMESTAMP_FORMAT 'timestamp_format_string'<p id="EN-US_TOPIC_0000001233708657__ac434513f80cf4a9a8be6e49f952ad1ee"><a name="EN-US_TOPIC_0000001233708657__ladbe486adea543a4bb7a9c11202fb68c"></a><a name="ladbe486adea543a4bb7a9c11202fb68c"></a>Specifies the TIMESTAMP format for data import. The BINARY format is not supported. When data of such format is imported, error "cannot specify bulkload compatibility options in BINARY mode" will occur. The parameter is valid only for data importing using the <strong id="EN-US_TOPIC_0000001233708657__b1818883194">COPY FROM</strong> option.</p>
<p id="EN-US_TOPIC_0000001233708657__aceed82c68c2148e781d790ca95a80925">Value range: any valid TIMESTAMP value. Time zones are not supported. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
</li><li id="EN-US_TOPIC_0000001233708657__l14107c57e70f418a8d56d1b9a26f51ce">SMALLDATETIME_FORMAT 'smalldatetime_format_string'<p id="EN-US_TOPIC_0000001233708657__aadd626d63bdc4dd8b08bc934f92c14c4"><a name="EN-US_TOPIC_0000001233708657__l14107c57e70f418a8d56d1b9a26f51ce"></a><a name="l14107c57e70f418a8d56d1b9a26f51ce"></a>Imports data of the SMALLDATETIME type. The BINARY format is not supported. When data of such format is imported, error "cannot specify bulkload compatibility options in BINARY mode" will occur. The parameter is valid only for data importing using the <strong id="EN-US_TOPIC_0000001233708657__b1007431980">COPY FROM</strong> option.</p>
<p id="EN-US_TOPIC_0000001233708657__a69f357a8337f46bfb381452ba66acadf">Value range: any valid SMALLDATETIME value. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
</li></ul>
<div class="p" id="EN-US_TOPIC_0000001233708657__a6ee11492a2da4b8394ebd52586e1fc5d">The following special backslash sequences are recognized by <strong id="EN-US_TOPIC_0000001233708657__b84235270617410">COPY FROM</strong>:<ul id="EN-US_TOPIC_0000001233708657__u759ff123504f48778b458f7fcf2ac5ce"><li id="EN-US_TOPIC_0000001233708657__l006cdc3b0c23412d92e11fc37d0cf874"><strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_adeb67f7ce2c941e38220a90f4602a6b1">\b</strong>: Backspace (ASCII 8)</li><li id="EN-US_TOPIC_0000001233708657__lfb69a45a585b4574a648e833bc911031"><strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_a2081f1a0b43a469c9fbc168490a69e4b">\f</strong>: Form feed (ASCII 12)</li><li id="EN-US_TOPIC_0000001233708657__ld12026f4041c486593ea4e472a73d993"><strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_a97d8a85e6735451994f0edb6a41cde18">\n</strong>: Newline character (ASCII 10)</li><li id="EN-US_TOPIC_0000001233708657__l4679b7cdfdce42b7b88668bea145142c"><strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_a1b553647f0a24d34852a80860c9e98ad">\r</strong>: Carriage return character (ASCII 13)</li><li id="EN-US_TOPIC_0000001233708657__lf82e7238374646e191ef9b2222711825"><strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_a58305a2bc45b45c384e5f2a1fe4b7b83">\t</strong>: Tab (ASCII 9)</li><li id="EN-US_TOPIC_0000001233708657__l3afe1ad9bd7c4305b0c9dce8a265d5db"><strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_a0ee39ee269314f278dbb6bedce78c7d9">\v</strong>: Vertical tab (ASCII 11)</li><li id="EN-US_TOPIC_0000001233708657__l06e0a95ed2e5401ea5dc7ff4a5154e47"><strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_a7e9229fdeb6e4e9eabe9ab97a8b52ea7">\digits</strong>: Backslash followed by one to three octal digits specifies the ASCII value is the character with that numeric code.</li><li id="EN-US_TOPIC_0000001233708657__l30f7fb33ee2a4ef1b7607131a9663756"><strong id="EN-US_TOPIC_0000001233708657__en-us_topic_0059778766_a06e98dc7bab840a8bea680e0a9167beb">\xdigits</strong>: Backslash followed by an x and one or two hex digits specifies the character with that numeric code.</li></ul>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001233708657__sf2c7aaee94ed43a683881e51d4e17d04"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001233708657__p12631825171120">Copy data from the <strong id="EN-US_TOPIC_0000001233708657__b52446293833647">ship_mode</strong> file to the <strong id="EN-US_TOPIC_0000001233708657__b53253796533647">/home/omm/ds_ship_mode.dat</strong> file.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen72612331116"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="n">ship_mode</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">'/home/omm/ds_ship_mode.dat'</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__p106313252117">Write <strong id="EN-US_TOPIC_0000001233708657__b43263950133647">ship_mode</strong> as output to <strong id="EN-US_TOPIC_0000001233708657__b58096234633647">stdout</strong>.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen16421134115119"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="n">ship_mode</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="k">stdout</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__p1763012512116">Create the <strong id="EN-US_TOPIC_0000001233708657__b46793621833647">ship_mode_t1</strong> table.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen9757125111112"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">ship_mode_t1</span>
<span class="p">(</span>
<span class="w"> </span><span class="n">SM_SHIP_MODE_SK</span><span class="w"> </span><span class="nb">INTEGER</span><span class="w"> </span><span class="k">NOT</span><span class="w"> </span><span class="k">NULL</span><span class="p">,</span>
<span class="w"> </span><span class="n">SM_SHIP_MODE_ID</span><span class="w"> </span><span class="nb">CHAR</span><span class="p">(</span><span class="mi">16</span><span class="p">)</span><span class="w"> </span><span class="k">NOT</span><span class="w"> </span><span class="k">NULL</span><span class="p">,</span>
<span class="w"> </span><span class="n">SM_TYPE</span><span class="w"> </span><span class="nb">CHAR</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">SM_CODE</span><span class="w"> </span><span class="nb">CHAR</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">SM_CARRIER</span><span class="w"> </span><span class="nb">CHAR</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">SM_CONTRACT</span><span class="w"> </span><span class="nb">CHAR</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span>
<span class="p">)</span>
<span class="k">WITH</span><span class="w"> </span><span class="p">(</span><span class="n">ORIENTATION</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">COLUMN</span><span class="p">,</span><span class="n">COMPRESSION</span><span class="o">=</span><span class="n">MIDDLE</span><span class="p">)</span>
<span class="n">DISTRIBUTE</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">HASH</span><span class="p">(</span><span class="n">SM_SHIP_MODE_SK</span><span class="w"> </span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__p863017259117">Copy data from <strong id="EN-US_TOPIC_0000001233708657__b123542663233647">stdin</strong> to the <strong id="EN-US_TOPIC_0000001233708657__b87780687133647">ship_mode_t1</strong> table.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen1227180161217"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="n">ship_mode_t1</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="k">stdin</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__p1463022521112">Copy data from the <strong id="EN-US_TOPIC_0000001233708657__b123389557333647">/home/omm/ds_ship_mode.dat</strong> file to the <strong id="EN-US_TOPIC_0000001233708657__b207589843933647">ship_mode_t1</strong> table.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen19249819129"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="n">ship_mode_t1</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="s1">'/home/omm/ds_ship_mode.dat'</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__p176303252113">Copy data from the <strong id="EN-US_TOPIC_0000001233708657__b60670974233647">/home/omm/ds_ship_mode.dat</strong> file to the <strong id="EN-US_TOPIC_0000001233708657__b149453991333647">ship_mode_t1</strong> table, with the import format set to TEXT (<strong id="EN-US_TOPIC_0000001233708657__b117859578133647">format 'text'</strong>), the delimiter set to \t' (delimiter <strong id="EN-US_TOPIC_0000001233708657__b79273375533647">E'\t'</strong>), excessive columns ignored (<strong id="EN-US_TOPIC_0000001233708657__b134842260433647">ignore_extra_data 'true'</strong>), and characters not escaped (<strong id="EN-US_TOPIC_0000001233708657__b26948654133647">noescaping 'true'</strong>).</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen213351913120"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="n">ship_mode_t1</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="s1">'/home/omm/ds_ship_mode.dat'</span><span class="w"> </span><span class="k">WITH</span><span class="p">(</span><span class="n">format</span><span class="w"> </span><span class="s1">'text'</span><span class="p">,</span><span class="w"> </span><span class="k">delimiter</span><span class="w"> </span><span class="n">E</span><span class="s1">'\t'</span><span class="p">,</span><span class="w"> </span><span class="n">ignore_extra_data</span><span class="w"> </span><span class="s1">'true'</span><span class="p">,</span><span class="w"> </span><span class="n">noescaping</span><span class="w"> </span><span class="s1">'true'</span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__p16308251115">Copy data from the <strong id="EN-US_TOPIC_0000001233708657__b76878353133647">/home/omm/ds_ship_mode.dat</strong> file to the <strong id="EN-US_TOPIC_0000001233708657__b11159380033647">ship_mode_t1</strong> table, with the import format set to FIXED, fixed-length format specified (<strong id="EN-US_TOPIC_0000001233708657__b13862869833647">FORMATTER(SM_SHIP_MODE_SK(0, 2), SM_SHIP_MODE_ID(2,16), SM_TYPE(18,30), SM_CODE(50,10), SM_CARRIER(61,20), SM_CONTRACT(82,20))</strong>), excessive columns ignored (<strong id="EN-US_TOPIC_0000001233708657__b81453160533647">ignore_extra_data</strong>), and headers included (<strong id="EN-US_TOPIC_0000001233708657__b1367443733647">header</strong>).</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen166031130191218"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="n">ship_mode_t1</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="s1">'/home/omm/ds_ship_mode.dat'</span><span class="w"> </span><span class="n">FIXED</span><span class="w"> </span><span class="n">FORMATTER</span><span class="p">(</span><span class="n">SM_SHIP_MODE_SK</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">),</span><span class="w"> </span><span class="n">SM_SHIP_MODE_ID</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">16</span><span class="p">),</span><span class="w"> </span><span class="n">SM_TYPE</span><span class="p">(</span><span class="mi">18</span><span class="p">,</span><span class="mi">30</span><span class="p">),</span><span class="w"> </span><span class="n">SM_CODE</span><span class="p">(</span><span class="mi">50</span><span class="p">,</span><span class="mi">10</span><span class="p">),</span><span class="w"> </span><span class="n">SM_CARRIER</span><span class="p">(</span><span class="mi">61</span><span class="p">,</span><span class="mi">20</span><span class="p">),</span><span class="w"> </span><span class="n">SM_CONTRACT</span><span class="p">(</span><span class="mi">82</span><span class="p">,</span><span class="mi">20</span><span class="p">))</span><span class="w"> </span><span class="n">header</span><span class="w"> </span><span class="n">ignore_extra_data</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__p28137212103">Export <strong id="EN-US_TOPIC_0000001233708657__b88051128560">ship_mode_t1</strong> as a text file <strong id="EN-US_TOPIC_0000001233708657__b2019842725613">ds_ship_mode.dat</strong> in the OBS directory <strong id="EN-US_TOPIC_0000001233708657__b18347621125714">/bucket/path/</strong>. You need to specify the server options that contain OBS access information.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen20135720131015"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="n">ship_mode_t1</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">'/bucket/path/ds_ship_mode.dat'</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="p">(</span><span class="n">format</span><span class="w"> </span><span class="s1">'text'</span><span class="p">,</span><span class="w"> </span><span class="k">encoding</span><span class="w"> </span><span class="s1">'utf8'</span><span class="p">,</span><span class="w"> </span><span class="n">server</span><span class="w"> </span><span class="s1">'obs_server'</span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__p2070519553105">Export <strong id="EN-US_TOPIC_0000001233708657__b26051135818">ship_mode_t1</strong> as a CSV file in the OBS directory <strong id="EN-US_TOPIC_0000001233708657__b4521114312116">/bucket/path/</strong>. You need to specify the server options that contain OBS access information. The file contains the title line and BOM header. A single file can contain a maximum of 1000 lines. If the number of lines exceeds 1000, a new file is generated. The user-defined file name prefix is <strong id="EN-US_TOPIC_0000001233708657__b63281326728">justprefix</strong>.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen3567817181113"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COPY</span><span class="w"> </span><span class="p">(</span><span class="k">select</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">from</span><span class="w"> </span><span class="n">ship_mode_t1</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">SM_SHIP_MODE_SK</span><span class="o">=</span><span class="mi">1060</span><span class="p">)</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">'/bucket/path/'</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="p">(</span><span class="n">format</span><span class="w"> </span><span class="s1">'csv'</span><span class="p">,</span><span class="w"> </span><span class="n">header</span><span class="w"> </span><span class="s1">'on'</span><span class="p">,</span><span class="w"> </span><span class="k">encoding</span><span class="w"> </span><span class="s1">'utf8'</span><span class="p">,</span><span class="w"> </span><span class="n">server</span><span class="w"> </span><span class="s1">'obs_server'</span><span class="p">,</span><span class="w"> </span><span class="n">bom</span><span class="w"> </span><span class="s1">'on'</span><span class="p">,</span><span class="w"> </span><span class="n">maxrow</span><span class="w"> </span><span class="s1">'1000'</span><span class="p">,</span><span class="w"> </span><span class="n">fileprefix</span><span class="w"> </span><span class="s1">'justprefix'</span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001233708657__p363092518113">Delete the <strong id="EN-US_TOPIC_0000001233708657__b97573225033647">ship_mode_t1</strong> table:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233708657__screen49411437111219"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">DROP</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">ship_mode_t1</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0227.html">DML Syntax</a></div>
</div>
</div>