doc-exports/docs/dws/tool/dws_16_0054.html
Lu, Huayi 27019c2991 DWS TOOL 830.201 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
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:35:25 +00:00

139 lines
8.7 KiB
HTML

<a name="EN-US_TOPIC_0000001772696108"></a><a name="EN-US_TOPIC_0000001772696108"></a>
<h1 class="topictitle1">Short Keys Migration</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p167182814326"><a href="#EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_table39390038143532">Table 1</a> lists the abbreviation keywords supported by Teradata and the corresponding syntax in GaussDB A and GaussDB(DWS).</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_table39390038143532"></a><a name="en-us_topic_0000001658025010_en-us_topic_0000001384550464_table39390038143532"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_table39390038143532" frame="border" border="1" rules="all"><caption><b>Table 1 </b>List of short keys</caption><thead align="left"><tr id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_row12260442143532"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.3.1.1"><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p414433914507"><strong id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_b111781032205816">Teradata Short Key</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.3.1.2"><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p8144439135014"><strong id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_b621016323584">GaussDB A and GaussDB(DWS) Syntax</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_row34909766143532"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p9118765143532">SEL</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p422521143532">SELECT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_row4185161914361"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p3453797414361">INS</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p4611251814361">INSERT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_row1940321514362"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p2815658414362">UPD</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p6609086614362">UPDATE</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_row6355292714364"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p4751344314364">DEL</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p2338366814364">DELETE</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_row022835015243"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p16228050112420">CT</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p192281150202420">CREATE TABLE</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_row1499612512259"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p179969516255">CV</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p99966562510">CREATE VIEW</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_row72782210459"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p927317400323">BT</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p18273124019323">START TRANSACTION</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_row132611453164417"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p8241641133211">ET</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p3241541143215">COMMIT</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p4883202015113"><strong id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_b1025492565310">Input - BT</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_screen13103758171010">BT;
--
delete from ${BRTL_DCOR}.BRTL_CS_CUST_CID_UID_REL
where DW_Job_Seq = ${v_Group_No};
.if ERRORCODE &lt;&gt; 0 then .quit 12;
--
insert into ${BRTL_DCOR}.BRTL_CS_CUST_CID_UID_REL
(
Cust_Id
,Cust_UID
,DW_Upd_Dt
,DW_Upd_Tm
,DW_Job_Seq
,DW_Etl_Dt
)
select
a.Cust_Id
,a.Cust_UID
,current_date as Dw_Upd_Dt
,current_time(0) as DW_Upd_Tm
,cast(${v_Group_No} as byteint) as DW_Job_Seq
,cast('${v_Trx_Dt}' as date format 'yyyy-mm-dd') as DW_Etl_Dt
from ${BRTL_VCOR}.BRTL_CS_CUST_CID_UID_REL_S a
where a.DW_Snsh_Dt = cast('${v_Trx_Dt}' as date format 'yyyy-mm-dd');
.if ERRORCODE &lt;&gt; 0 then .quit 12;
ET;cd ..</pre>
<p id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_p17726251151010"><strong id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_b1961311675914">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001772696108__en-us_topic_0000001658025010_en-us_topic_0000001384550464_screen464318483114">BEGIN
--
BEGIN
delete from ${BRTL_DCOR}.BRTL_CS_CUST_CID_UID_REL
where DW_Job_Seq = ${v_Group_No};
lv_mig_errorcode = 0;
EXCEPTION
WHEN OTHERS THEN
lv_mig_errorcode = -1;
END;
IF lv_mig_errorcode &lt;&gt; 0 THEN
RAISE EXCEPTION '12';
END IF;
--
BEGIN
insert into ${BRTL_DCOR}.BRTL_CS_CUST_CID_UID_REL
(
Cust_Id
,Cust_UID
,DW_Upd_Dt
,DW_Upd_Tm
,DW_Job_Seq
,DW_Etl_Dt
)
select
a.Cust_Id
,a.Cust_UID
,current_date as Dw_Upd_Dt
,current_time(0) as DW_Upd_Tm
,cast(${v_Group_No} as byteint) as DW_Job_Seq
,cast('${v_Trx_Dt}' as date format 'yyyy-mm-dd') as DW_Etl_Dt
from ${BRTL_VCOR}.BRTL_CS_CUST_CID_UID_REL_S a
where a.DW_Snsh_Dt = cast('${v_Trx_Dt}' as date format 'yyyy-mm-dd');
EXCEPTION
WHEN OTHERS THEN
lv_mig_errorcode = -1;
END;
IF lv_mig_errorcode &lt;&gt; 0 THEN
RAISE EXCEPTION '12';
END IF;
END;</pre>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_16_0049.html">Query Migration Operators</a></div>
</div>
</div>