Files
doc-exports/docs/dws/tool/dws_16_0086.html
luhuayi a5e3903f6b DWS TG 910.211 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: luhuayi <luhuayi@huawei.com>
Co-committed-by: luhuayi <luhuayi@huawei.com>
2025-04-23 13:53:01 +00:00

23 lines
2.1 KiB
HTML

<a name="EN-US_TOPIC_0000001813598824"></a><a name="EN-US_TOPIC_0000001813598824"></a>
<h1 class="topictitle1">INSERT</h1>
<div id="body32001227"><p id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_p1430752710418">The Teradata <strong id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_b121092162632219">INSERT</strong> (<a href="dws_16_0054.html#EN-US_TOPIC_0000001860198793">short key</a> INS) statement is used to insert records into a table. DSC supports the <strong id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_b41280374432219">INSERT</strong> statement.</p>
<p id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_p16938356121816">The <strong id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_b170202823432219">INSERT INTO TABLE table_name</strong> syntax is used in Teradata SQL, but is not supported by GaussDB(DWS). GaussDB(DWS) supports only <strong id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_b107491719402">INSERT INTO table_name</strong>. Therefore, remove the keyword <strong id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_b21408779832219">TABLE</strong> when using DSC.</p>
<p id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_p153171341142019"><strong id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_b1998848172019">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_screen34181629142210">INSERT TABLE tab1
SELECT col1, col2
FROM tab2
WHERE col3 &gt; 0;</pre>
<p id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_p1067110422201"><strong id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_b1441749102013">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001813598824__en-us_topic_0000001434910257_screen6214336224">INSERT INTO tab1
SELECT col1, col2
FROM tab2
WHERE col3 &gt; 0;</pre>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_16_0084.html">Data Manipulation Language (DML)</a></div>
</div>
</div>