doc-exports/docs/dws/tool/dws_07_6826.html
Lu, Huayi 346ac31da9 DWS TG 8.1.3.200 VERSION
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-08-28 09:20:17 +00:00

104 lines
10 KiB
HTML

<a name="EN-US_TOPIC_0000001234042207"></a><a name="EN-US_TOPIC_0000001234042207"></a>
<h1 class="topictitle1">DML</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_section42271120151011"><h4 class="sectiontitle">Gauss keyword: SOURCE specified as column-alias without AS keyword</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_table118673385576" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_row1486719383573"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.1.2.1.3.1.1"><p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p169681440152618"><strong id="EN-US_TOPIC_0000001234042207__en-us_topic_0237712358_b4867738105711">Netezza Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.1.2.1.3.1.2"><p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p19968340142613"><strong id="EN-US_TOPIC_0000001234042207__en-us_topic_0237712358_b81851635102616">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_row5867163811577"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.2.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_screen6928125915812">SELECT SUBSTR( OP_SOURCE ,1 ,4 ) SOURCE
, ONLINE_FLAG, 'TRD' AS SRC_SYS
, CURRENT_TIMESTAMP AS ETL_LOAD_TIME
FROM tb_keyword_source;</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.2.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_screen1693016425105">SELECT SUBSTR( OP_SOURCE ,1 ,4 ) AS SOURCE
, ONLINE_FLAG, 'TRD' AS SRC_SYS
, CURRENT_TIMESTAMP AS ETL_LOAD_TIME
FROM tb_keyword_source;</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_section1656016216149"><h4 class="sectiontitle">FREEZE</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_table141731216165917" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_row1817391645919"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.1.3.1.1"><p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p1277142618285"><strong id="EN-US_TOPIC_0000001234042207__en-us_topic_0237712358_b181731416175913">Netezza Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.1.3.1.2"><p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p10771142652815"><strong id="EN-US_TOPIC_0000001234042207__en-us_topic_0237712358_b19944201133015">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_row4173191611598"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_screen74216204148">INSERT INTO tmp_tb_keyword_freeze
( BRANCH_CODE, FREEZE, UNFREEZE, BRAN_JYSDM )
SELECT BRANCH_CODE, FREEZE, UNFREEZE, BRAN_JYSDM
FROM tb_keyword_freeze;</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_screen1029282371417">INSERT INTO tmp_tb_keyword_freeze
( BRANCH_CODE, "FREEZE", UNFREEZE, BRAN_JYSDM )
SELECT BRANCH_CODE, "FREEZE", UNFREEZE, BRAN_JYSDM
FROM tb_keyword_freeze;</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_note1963010371715"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p24677471111">A new configuration parameter "keywords_addressed_using_doublequote" should be introduced with the below value:</p>
<p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p204688473111">keywords_addressed_using_doublequote=freeze</p>
<p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p13468147211">keywords_addressed_using_as=owner,attribute,source,freeze</p>
<p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p1446816479112">create table t12 (c1 int, FREEZE varchar(10)); ==&gt; create table t12 (c1 int, "freeze" varchar(10));</p>
<p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p144681547316">select c1, Freeze from t12; ==&gt; select c1, "freeze" from t12;</p>
<p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p1746894715119">select c1 freeze from t12; ==&gt; select c1 as freeze from t12;</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_section9266115603017"><h4 class="sectiontitle">OWNER (AS should be specified)</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_table3424164019016" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_row042424017019"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.2.1.3.1.1"><p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p81689308287"><strong id="EN-US_TOPIC_0000001234042207__en-us_topic_0237712358_b842434012011">Netezza Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.2.1.3.1.2"><p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p1316833092812"><strong id="EN-US_TOPIC_0000001234042207__en-us_topic_0237712358_b1975917320303">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_row114252401504"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_screen11181184317300">SELECT username owner
FROM tb_ntz_keyword_owner;</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_screen195331467305">SELECT username AS owner
FROM tb_ntz_keyword_owner;</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_section112071346153111"><h4 class="sectiontitle">ATTRIBUTE (AS should be specified)</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_table12133183511" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_row1613313318120"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.2.1.3.1.1"><p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p16760432192811"><strong id="EN-US_TOPIC_0000001234042207__en-us_topic_0237712358_b15133731116">Netezza Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.2.1.3.1.2"><p id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_p1876019323281"><strong id="EN-US_TOPIC_0000001234042207__en-us_topic_0237712358_b112921857308">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_row513303019"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_screen10109171014120">SELECT t1.etl_date, substr(t1.attribute,1,1) attribute
, t1.cust_no, t1.branch_code
FROM ( SELECT etl_date,attribute,cust_no,branch_code
FROM tb_ntz_keyword_attribute
WHERE etl_date = CURRENT_DATE ) t1;</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001234042207__en-us_topic_0238518436_en-us_topic_0237362513_en-us_topic_0213479756_screen63788993219">SELECT t1.etl_date, substr(t1.attribute,1,1) AS attribute
, t1.cust_no, t1.branch_code
FROM ( SELECT etl_date,attribute,cust_no,branch_code
FROM tb_ntz_keyword_attribute
WHERE etl_date = CURRENT_DATE ) t1;</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_07_0682.html">Netezza Syntax Migration</a></div>
</div>
</div>