doc-exports/docs/dws/tool/dws_07_6845.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

58 lines
5.1 KiB
HTML

<a name="EN-US_TOPIC_0000001188202564"></a><a name="EN-US_TOPIC_0000001188202564"></a>
<h1 class="topictitle1">Statement</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_section3296175312579"><h4 class="sectiontitle">CURRENT SCHEMA</h4><p id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_p173215532575">SET CURRENT SCHEMA</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_table1329725317573" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_row20321105312570"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.1.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_p17321853185715"><strong id="EN-US_TOPIC_0000001188202564__b6940164224710">DB2 Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.1.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_p532155318571"><strong id="EN-US_TOPIC_0000001188202564__b20452104613477">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_row1032114539575"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_screen113212534578">CREATE NICKNAME sc2.emp FOR sc.emp;</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_screen14321145315570">CREATE SYNONYM sc2.emp FOR sc.emp;</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_section16187102695218"><h4 class="sectiontitle">GET DIAGNOSTICS with ROW_COUNT</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_table16190202645220" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_row1523322665215"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.1.3.1.1"><p id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_p2233182616526"><strong id="EN-US_TOPIC_0000001188202564__b1016625894719">DB2 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_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_p9233122612529"><strong id="EN-US_TOPIC_0000001188202564__b71445120483">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_row123312615528"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_screen1234112611524">CC_ORDER_HY_CUSTORCOUNT SET '
||STR_CUST_COUNT||'_COUNT='||char(CUST_COUNT)||' ,'
||'SELF_UPDATE_TIME ='||''''||STR_DATE||''''||' ,'
||'SUB_UPDATE_TIME ='||''''||STR_DATE1||''''||','
||'REPORT_STATE ='||''''|| STR_CHAR ||''''
||' WHERE ORG_CODE ='||''''||TEMP_ORG_CODE||''''
||' AND Y='||char(TEMP_YEAR)||' AND HY='||char(TEMP_HY)
||' AND REGION_CODE='||''''||TEMP_SALE_REG_CODE||''''||' AND BRAND_CODE='||''''||TEMP_BRAND_CODE||''''
||' AND exists (select 1 from CC_ORDER_HY_CUSTORCOUNT'
||' where ORG_CODE ='||''''||TEMP_ORG_CODE||''''
||' AND Y='||char(TEMP_YEAR)||' AND HY='||char(TEMP_HY)
||' AND REGION_CODE='||''''||TEMP_SALE_REG_CODE||''''||' AND BRAND_CODE='||''''||TEMP_BRAND_CODE||''''||')';--
PREPARE S1 FROM STR_UPDATE1;
EXECUTE S1; --
GET DIAGNOSTICS V_NUMRECORDS = ROW_COUNT; </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_0000001188202564__en-us_topic_0238518458_en-us_topic_0237362128_en-us_topic_0213529186_screen523452618521">V_NUMRECORDS = SQL%ROWCOUNT;</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_07_0684.html">DB2 Syntax Migration</a></div>
</div>
</div>