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

532 lines
50 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="EN-US_TOPIC_0000001234200593"></a><a name="EN-US_TOPIC_0000001234200593"></a>
<h1 class="topictitle1">PL/SQL</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p489117110424">This section describes the migration syntax of Oracle PL/SQL. The migration syntax determines how the keywords and features are migrated.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_p3228581622416">PL/SQL combines the procedural features of SQL and programming languages.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p4989181964211"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b612713559531">SQL Commands</strong></p>
<p id="EN-US_TOPIC_0000001234200593__p761643615212">Currently, <span id="EN-US_TOPIC_0000001234200593__text194151720165311">GaussDB(DWS)</span> does not support <strong id="EN-US_TOPIC_0000001234200593__b1596918479316">set define off</strong>/<strong id="EN-US_TOPIC_0000001234200593__b165382500311">on </strong>and <strong id="EN-US_TOPIC_0000001234200593__b1770219541135">spool off</strong>. Comment out related commands in the database.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_table584475133312" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_row1845125118331"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.1.3.1.1"><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_p16390192954112"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b484515110336">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.1.3.1.2"><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_p239062915415"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b81851635102616">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_row1184555163312"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_screen9277190144119">set define off
spool ORACLE.log
create table product
(
product_id VARCHAR2(20),
product_name VARCHAR2(50)
);
spool off</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_screen73336104418">/*set define off;*/
/*spool ORACLE.log*/
CREATE TABLE product
(
product_id VARCHAR2(20),
product_name VARCHAR2(50)
);
/*spool off*/</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p240916184812">For details, see the following topics:</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p4297173394818"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_section1391922754020">EDITIONABLE</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p154298494915"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section1581115584422">Variable Assignment</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p727351334911"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section989838174412">END</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p12892114114913"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section32061613114410">EXCEPTION Handling</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p203135218491"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section12591916124410">Subtransaction Handling</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p1291992710492"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section738910174442">STRING</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p109851134104910"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section1516831816441">LONG</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p71722417497"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section6820141813446">RESULT_CACHE</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p8481154814916"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section164471719194417">Relational Operators with Spaces</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p1341815114507"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section105132074419">Substitution Variables</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p1315763115016"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section9567720114418">PARALLEL_ENABLE</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p422019117502"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section811752144411">TRUNCATE TABLE</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p10769141813506"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section268672110441">ALTER SESSION</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p975061615617"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section7843536105516">AUTONOMOUS</a></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p014982619504"><a href="#EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section162341522154412">Procedure Call</a></p>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_section1391922754020"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_section1391922754020"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727061_section1391922754020"></a><h4 class="sectiontitle">EDITIONABLE</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727362_p16396171907">The EDITIONABLE keyword is not supported in GaussDB. So it needs to be removed from the target database.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727362_p123962711011"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b194151514583">Input EDITIONABLE</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727362_screen14396471306">CREATE OR REPLACE EDITIONABLE PACKAGE "PACK1"."PACKAGE_SEND_MESSAGE"
AS
TYPE filelist IS REF CURSOR;
PROCEDURE get_message_info (in_userid IN VARCHAR2,
in_branchid IN VARCHAR2,
in_appverid IN VARCHAR2,
in_app_list_flag IN VARCHAR2,
in_filetype IN VARCHAR2,
in_filestate IN VARCHAR2,
o_retcode OUT VARCHAR2,
o_errormsg OUT VARCHAR2,
o_seq OUT VARCHAR2,
o_totalnum OUT NUMBER,
o_filelist OUT filelist);</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727362_p6398770017"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b34168519581">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727362_screen153981871502">/*~~PACKAGE_SEND_MESSAGE~~*/
CREATE
SCHEMA PACKAGE_SEND_MESSAGE
;</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section1581115584422"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section1581115584422"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section1581115584422"></a><h4 class="sectiontitle">Variable Assignment</h4><div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727448_fig128971249104020"><span class="figcap"><b>Figure 1 </b>Input - PL/SQL</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727448_image128981949154018" src="figure/en-us_image_0000001233922293.png"></span></div>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727448_fig1189814499405"><span class="figcap"><b>Figure 2 </b>Output - PL/SQL</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727448_image20898124911403" src="figure/en-us_image_0000001188202690.png"></span></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section989838174412"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section989838174412"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section989838174412"></a><h4 class="sectiontitle">END</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_p165823714323">END with label is not supported in GaussDB T, so, the label name is removed during migration.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727398_p71941843517"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b374075314351">Input - END with a procedure name</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727398_screen14184188193514">CREATE OR REPLACE PROCEDURE sp_ins_emp
...
END sp_ins_emp;</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727398_p95129582350"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b138257519367">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727398_screen883998123613">CREATE OR REPLACE PROCEDURE sp_ins_emp
...
END;</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727398_p85261339125316"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b142661538123718">Input - END with a function name</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727398_screen19097914377">CREATE FUNCTION fn_get_bal
...
END get_bal;
/</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727398_p09731499371"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b6973154915378">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727398_screen196824918376">CREATE FUNCTION fn_get_bal
...
END;
/</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section32061613114410"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section32061613114410"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section32061613114410"></a><h4 class="sectiontitle">EXCEPTION Handling</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727082_p522511385322"><span id="EN-US_TOPIC_0000001234200593__text1958020141713">GaussDB(DWS)</span> does not support <strong id="EN-US_TOPIC_0000001234200593__b570510015583">EXCEPTION</strong> handling. To migrate scripts to V100R200C60, set the <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b1426641324010">exceptionHandler</strong> parameter to <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b122951323164013">True</strong>.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727082_p1789112519293">For DSC 18.2.0, this parameter must be set to the default value <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b189608499455">False</strong>.</p>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727082_fig101945142423"><span class="figcap"><b>Figure 3 </b>Input - EXCEPTION Handling</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727082_image2761545185411" src="figure/en-us_image_0000001233922295.png"></span></div>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727082_fig18195171417422"><span class="figcap"><b>Figure 4 </b>Output - EXCEPTION Handling</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727082_image185845285415" src="figure/en-us_image_0000001188202688.png"></span></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section12591916124410"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section12591916124410"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section12591916124410"></a><h4 class="sectiontitle">Subtransaction Handling</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727232_p0235184133116">Subtransaction (that is commit and rollback statements in PL/SQL) is not supported. This parameter must be set to the default <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b126008597275">True</strong>.</p>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727232_fig1555393515428"><span class="figcap"><b>Figure 5 </b>Input - Subtransaction Handling</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727232_image720311919557" src="figure/en-us_image_0000001234200729.png"></span></div>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727232_fig355415351428"><span class="figcap"><b>Figure 6 </b>Output - Subtransaction Handling</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727232_image461891655511" src="figure/en-us_image_0000001188521208.png"></span></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section738910174442"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section738910174442"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section738910174442"></a><h4 class="sectiontitle">STRING</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727321_p17115139153516">STRING is an Oracle PL/SQL data type that is not supported by GaussDB T. This data type is handled by using VARCHAR.</p>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727321_fig19974205164211"><span class="figcap"><b>Figure 7 </b><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b3690105125013">Input</strong> - <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b1110795685020">STRING</strong></span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727321_image9892204845518" src="figure/en-us_image_0000001188681128.png"></span></div>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727321_fig10975195174211"><span class="figcap"><b>Figure 8 </b><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b1972220135112">Output</strong> - <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b187313445112">STRING</strong></span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727321_image540565616559" src="figure/en-us_image_0000001188681126.png"></span></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section1516831816441"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section1516831816441"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section1516831816441"></a><h4 class="sectiontitle">LONG</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727333_p154241338141513">LONG is migrated as TEXT.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727333_p049951961117"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b554435325311">Input - LONG</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727333_screen195001619111113">CREATE OR REPLACE FUNCTION fn_proj_det
( i_proj_cd INT )
RETURN LONG
IS
v_proj_det LONG;
BEGIN
SELECT proj_det
INTO v_proj_det
FROM project
WHERE proj_cd = i_proj_cd;
RETURN v_proj_det;
END;
/</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727333_p205061819201115"><strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_b5653135565316">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727333_screen72992283214">CREATE OR REPLACE FUNCTION fn_proj_det
( i_proj_cd INT )
RETURN TEXT
IS
v_proj_det TEXT;
BEGIN
SELECT proj_det
INTO v_proj_det
FROM project
WHERE proj_cd = i_proj_cd;
RETURN v_proj_det;
END;
/</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section6820141813446"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section6820141813446"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section6820141813446"></a><h4 class="sectiontitle">RESULT_CACHE</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727436_p18506756144818">When a function with result cache is called, Oracle executes the function, adds the result to the result cache, and then returns the function.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727436_p10506656184816">When the function call is repeated, Oracle fetches the results from the cache rather than re-executing the function.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727436_p1750685619488">Under certain scenarios, this caching behavior can result in significant performance gains.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727436_p2506175684820">The target database does not support this keyword, which will be removed from the target file.</p>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727436_fig105071056134813"><span class="figcap"><b>Figure 9 </b>Input - RESULT_CACHE</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727436_image19507185619485" src="figure/en-us_image_0000001234042243.png"></span></div>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727436_fig14507356174816"><span class="figcap"><b>Figure 10 </b>Output - RESULT_CACHE</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727436_image1950845674818" src="figure/en-us_image_0000001234200733.png"></span></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section164471719194417"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section164471719194417"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section164471719194417"></a><h4 class="sectiontitle">Relational Operators with Spaces</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0237712287_p1963981484413">The relational operators (&lt;=, &gt;=, !=) with spaces are not supported by <span id="EN-US_TOPIC_0000001234200593__text1170343423216">GaussDB(DWS)</span>. DSC removes spaces between the operators.</p>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727355_fig1269895344913"><span class="figcap"><b>Figure 11 </b>Input - Relational operator</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727355_image5814216185614" src="figure/en-us_image_0000001233922291.png"></span></div>
<div class="fignone" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727355_fig1698155314494"><span class="figcap"><b>Figure 12 </b>Output - Relational operator</span><br><span><img id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727355_image321812511562" src="figure/en-us_image_0000001188202692.png"></span></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section105132074419"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section105132074419"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section105132074419"></a><h4 class="sectiontitle">Substitution Variables</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727422_p162161755155113">Substitution variables are a feature of Oracle SQL*Plus tool. When a substitution variable is used in a statement, SQL*Plus requests an input value and rewrites the statement to include it. The rewritten statement is passed to the Oracle database. When the Oracle script input contains any substitution variables, the DSC displays the following message. Messages are recorded in the console and log files.</p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727422_screen195873314283">**************************************************************************
USER ATTENTION!!! Variable: &amp;bbid should be substituted in the file : "/home/testmigration/V100R002C60/MigrationTool/Input/proc_frss_jczbsc.SQL" Variable: &amp;wdbs should be substituted in the file : "/home/testmigration/V100R002C60/MigrationTool/Input/proc_frss_jczbsc.SQL" Variable: &amp;batch_no should be substituted in the file : "/home/testmigration/V100R002C60/MigrationTool/Input/proc_frss_jczbsc.SQL"
**************************************************************************</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section9567720114418"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section9567720114418"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section9567720114418"></a><h4 class="sectiontitle">PARALLEL_ENABLE</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p1557519571246">In Oracle, PARALLEL_ENABLE is used to enable parallel loading among partitions.</p>
</div>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727295_p049951961117"><strong id="EN-US_TOPIC_0000001234200593__b1783316116462">Input - PARALLEL_ENABLE</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727295_screen195001619111113">CREATE OR REPLACE FUNCTION F_REPLACE_COMMA (IS_STR IN VARCHAR2)
RETURN VARCHAR2
parallel_enable
IS
BEGIN
IF IS_STR IS NULL THEN
RETURN NULL;
ELSE
RETURN REPLACE(REPLACE(IS_STR, CHR(13) || CHR(10), ''), ',', ', ');
END IF;
END F_REPLACE_COMMA;
/</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727295_p205061819201115"><strong id="EN-US_TOPIC_0000001234200593__b481818164469">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727295_screen1950791921112">CREATE OR REPLACE FUNCTION F_REPLACE_COMMA (IS_STR IN VARCHAR2)
RETURN VARCHAR2
IS
BEGIN
IF IS_STR IS NULL THEN
RETURN NULL;
ELSE
RETURN REPLACE(REPLACE(IS_STR, CHR(13) || CHR(10), ''), ',', ', ');
END IF;
END;
/</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p131511053135317"></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p1067593918533"><strong id="EN-US_TOPIC_0000001234200593__b189842234617">PARALLEL Clause</strong></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727295_p15905249174416">PARALLEL should be commented.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727295_p0114603455"><strong id="EN-US_TOPIC_0000001234200593__b99831233154612">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727295_screen1157961814454">CREATE TABLE PRODUCT
( prod_id INTEGER NOT NULL PRIMARY KEY
, prod_code VARCHAR(5)
, prod_name VARCHAR(100)
, unit_price NUMERIC(6,2) NOT NULL )
PARALLEL 8;</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727295_p24218514459"><strong id="EN-US_TOPIC_0000001234200593__b830911393467">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727295_screen9761152294519">CREATE TABLE PRODUCT
( prod_id INTEGER NOT NULL PRIMARY KEY
, prod_code VARCHAR(5)
, prod_name VARCHAR(100)
, unit_price NUMERIC(6,2) NOT NULL )
/* PARALLEL 8 */;</pre>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section811752144411"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section811752144411"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section811752144411"></a><h4 class="sectiontitle">TRUNCATE TABLE</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_p15672135110383">The <strong id="EN-US_TOPIC_0000001234200593__b385334310467">TRUNCATE TABLE</strong> statement in Oracle is used to remove all records from a table. It performs the same function as a DELETE statement without a WHERE clause. After truncating, the table will exist but it will be empty. DSC supports migration of TRUNCATE TABLE statements with static table names only. Migration of TRUNCATE TABLE statements with dynamic table names are not supported by the tool.</p>
<div class="note" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_note20992112119159"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_p899252117150">The tool does not support migration of TRUNCATE TABLE statements with dynamic table names.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_p1263152233515">Example: l_table :='truncate table ' || <strong id="EN-US_TOPIC_0000001234200593__b560241244714">itable_name</strong></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_p1990821515304">In this example, <strong id="EN-US_TOPIC_0000001234200593__b1259971815474">itable_name</strong> indicates a dynamic table name and is not supported by the DSC. The unsupported statements will be copied verbatim to the migrated scripts.</p>
</div></div>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_p6137193510573"><strong id="EN-US_TOPIC_0000001234200593__b162031532154712">Input - TRUNCATE TABLE</strong> <strong id="EN-US_TOPIC_0000001234200593__b720314325476">with Execute Immediate</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_screen313816353577">CREATE OR REPLACE PROCEDURE <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_b1132123713418">schema1.</strong>proc1
AS
BEGIN
EXECUTE IMMEDIATE 'TRUNCATE TABLE <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_b53210371747">QUERY_TABLE</strong>';
End proc1;
/</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_p15151335105717"><strong id="EN-US_TOPIC_0000001234200593__b1502103713470">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_screen131531856124712">CREATE
OR REPLACE PROCEDURE <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_b1410818521444">schema1</strong>.proc1 AS BEGIN
EXECUTE IMMEDIATE 'TRUNCATE TABLE <strong id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_b91083524412">schema1.QUERY_TABLE</strong>' ;
end ;
/</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_p2098375817517"><strong id="EN-US_TOPIC_0000001234200593__b15222842194712">Input - TRUNCATE TABLE</strong> <strong id="EN-US_TOPIC_0000001234200593__b15222124244717">inside procedure</strong></p>
<div class="note" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_note7488152319715"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_p948912231976">Migration tool does not add schema names for dynamic PL/SQL statements.</p>
</div></div>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_screen1398320589511">CREATE
OR REPLACE PROCEDURE schemName.sp_dd_table ( itable_name VARCHAR2 ) IS l_table VARCHAR2 ( 255 ) ;
BEGIN
l_table :='truncate table ' || itable_name ;
---- dbms_utility.exec_ddl_statement(l_table);
dbms_output.put_line ( itable_name || ' ' || 'Truncated' ) ;
END sp_dd_table ;
/</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_p11984195812512"><strong id="EN-US_TOPIC_0000001234200593__b71697213482">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727411_screen159851458758">CREATE
OR REPLACE PROCEDURE schemName.sp_dd_table ( itable_name VARCHAR2 ) IS l_table VARCHAR2 ( 255 ) ;
BEGIN
l_table :='truncate table ' || itable_name ;
/*
dbms_utility.exec_ddl_statement(l_table); */
dbms_output.put_line ( itable_name || ' ' || 'Truncated' ) ;
end ;
/</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section268672110441"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section268672110441"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section268672110441"></a><h4 class="sectiontitle">ALTER SESSION</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_p6513616442">The <strong id="EN-US_TOPIC_0000001234200593__b104537815487">ALTER SESSION</strong> statement in Oracle is used to set or modify the parameters and behavior of the database connection. The statement stays in effect until you disconnect from the database. The DSC supports the migration of ALTER SESSION as follows:</p>
<ul id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_ul155341428526"><li id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_li5534194205217">ALTER SESSION with ADVISE, ENABLE, DISABLE, CLOSE and FORCE clauses are migrated as commented scripts.</li><li id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_li1453444213524">ALTER SESSION with SET CLAUSE parameter (Example: NLS_DATE_FORMAT, NLS_DATE_LANGUAGE, and so on) are copied verbatim.</li></ul>
<div class="note" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_note20992112119159"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_p899252117150">The tool does not support migration of ALTER SESSION statements that have a variable for the command clause.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_p1990821515304">Example: EXECUTE IMMEDIATE ' alter session ' || <strong id="EN-US_TOPIC_0000001234200593__b476813024919"><em id="EN-US_TOPIC_0000001234200593__i157682015492">command_val</em></strong> || 'parallel ' || type_value.</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_p139693015172">In this example, <strong id="EN-US_TOPIC_0000001234200593__b3399211154912">command_val</strong> is a variable and this is not supported by the DSC. The unsupported statements will be copied verbatim in the migrated scripts.</p>
</div></div>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_p6137193510573"><strong id="EN-US_TOPIC_0000001234200593__b3865142319498">Input - ALTER SESSION</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_screen313816353577">ALTER SESSION ENABLE PARALLEL DDL;
ALTER SESSION ADVISE COMMIT;
ALTER SESSION CLOSE DATABASE LINK local;
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY MM DD HH24:MI:SS';
ALTER SESSION SET current_schema = 'isfc';</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_p15151335105717"><strong id="EN-US_TOPIC_0000001234200593__b29986285494">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_screen915373512573">/*ALTER SESSION ENABLE PARALLEL DDL;*/
/*ALTER SESSION ADVISE COMMIT;*/
/*ALTER SESSION CLOSE DATABASE LINK local;*/
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY MM DD HH24:MI:SS';
ALTER SESSION SET current_schema = 'isfc';</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_p84321361474"><strong id="EN-US_TOPIC_0000001234200593__b1277314322497">Input - ALTER SESSION</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_screen1214402412216">Create or replace
PROCEDURE PUBLIC .TEST_CALL is
command_val varchar2 ( 1000 ) ;
type_value number ;
BEGIN
command_val := 'enable parallel ddl' ;
dbms_output.put_line ( mike ) ;
-- execute immediate 'ALTER SESSION DISABLE GUARD' ;
execute immediate 'ALTER SESSION ADVISE ROLLBACK' ;
EXECUTE IMMEDIATE ' alter session ' || command_val || 'parallel ' || type_value ;
END TEST_CALL;
/
</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_p1715382417220"><strong id="EN-US_TOPIC_0000001234200593__b17698164414499">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727132_screen5153172422211">Create or replace
PROCEDURE PUBLIC.TEST_CALL is
command_val varchar2 ( 1000 ) ;
type_value number ;
BEGIN
command_val := 'enable parallel ddl' ;
dbms_output.put_line ( mike ) ;
/* execute immediate 'ALTER SESSION DISABLE GUARD' ; */
execute immediate '/*ALTER SESSION ADVISE ROLLBACK*/' ;
EXECUTE IMMEDIATE 'alter session ' || command_val || 'parallel ' || type_value ;
END ;
/</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section7843536105516"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section7843536105516"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section7843536105516"></a><h4 class="sectiontitle">AUTONOMOUS</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727175_p15863541815"><strong id="EN-US_TOPIC_0000001234200593__b1789914964919">Input - AUTONOMOUS</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727175_screen05861541184">CREATE OR REPLACE EDITIONABLE PACKAGE BODY "Pack1"."DEMO_PROC" is
PROCEDURE log(proc_name IN VARCHAR2, info IN VARCHAR2) IS
PRAGMA AUTONOMOUS_TRANSACTION;</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727175_p175861254789"><strong id="EN-US_TOPIC_0000001234200593__b12221115513491">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727175_screen45881254283">CREATE OR REPLACE PROCEDURE DEMO_PROC.log ( proc_name IN VARCHAR2 ,info IN VARCHAR2 ) IS
/*PRAGMA AUTONOMOUS_TRANSACTION;*/</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section162341522154412"><a name="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_section162341522154412"></a><a name="en-us_topic_0238518402_en-us_topic_0237362234_section162341522154412"></a><h4 class="sectiontitle">Procedure Call</h4><p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_p19332312195512">Procedure with no parameter needs to put () after procedure name while calling the same procedure.</p>
</div>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p2678132334511">For example, pkg_etl.clear_temp_tables()</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p13381009462"><strong id="EN-US_TOPIC_0000001234200593__b192422031145011">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_screen68591516194611">CREATE OR REPLACE PACKAGE BODY IC_STAGE.pkg_etl
AS
PROCEDURE clear_temp_tables
IS
BEGIN
NULL;
END clear_temp_tables;
END pkg_etl;
/
CREATE OR REPLACE PACKAGE BODY IC_STAGE.PKG_REVN_ARPU
AS
PROCEDURE AGGR_X_AGG00_REVN_DEALER (p_date PLS_INTEGER,
p_days PLS_INTEGER)
AS
v_start_date PLS_INTEGER;
v_curr_date PLS_INTEGER;
BEGIN
v_start_date := TO_CHAR (TO_DATE (p_date, 'yyyymmdd') - (p_days - 1), 'yyyymmdd');
v_curr_date := p_date;
WHILE (v_curr_date &gt;= v_start_date)
LOOP
pkg_etl.clear_temp_tables;
pkg_dw.bind_variable ('v_curr_date', v_curr_date);
v_curr_date := TO_CHAR (TO_DATE (v_curr_date, 'yyyymmdd') - 1, 'yyyymmdd');
END LOOP;
END;
END PKG_REVN_ARPU;
/ </pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p10797195742918"><strong id="EN-US_TOPIC_0000001234200593__b1966844515011">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_screen93869316477">CREATE OR REPLACE PROCEDURE IC_STAGE.pkg_etl#clear_temp_tables PACKAGE IS
BEGIN
NULL ;
END ;
/
CREATE OR REPLACE PROCEDURE IC_STAGE.PKG_REVN_ARPU#AGGR_X_AGG00_REVN_DEALER
( p_date INTEGER
, p_days INTEGER )
PACKAGE
AS
v_start_date INTEGER;
v_curr_date INTEGER;
BEGIN
v_start_date := TO_CHAR( TO_DATE( p_date ,'yyyymmdd' ) - ( p_days - 1 ), 'yyyymmdd' ) ;
v_curr_date := p_date ;
WHILE ( v_curr_date &gt;= v_start_date )
LOOP
pkg_etl#clear_temp_tables ( ) ;
pkg_dw.bind_variable ( 'v_curr_date' ,v_curr_date ) ;
v_curr_date := TO_CHAR( TO_DATE( v_curr_date ,'yyyymmdd' ) - 1,'yyyymmdd' ) ;
END LOOP ;
END ;
/</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p59241229128"><strong id="EN-US_TOPIC_0000001234200593__b96019520501">Function Name Having No Parameter Is Called</strong></p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p11957271933">Function name which does not have any parameter, called by function name with parameter is not supported in EXCEPTION statement that is SAD.SAD_CALC_ITEM_PKG_TEST_OB#error_msg ( ) but this function error_msg is defined without parameter that is</p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_screen72079223370">CREATE
OR REPLACE FUNCTION SAD.SAD_CALC_ITEM_PKG_TEST_OB#func_name
RETURN VARCHAR2 IS MIG_PV_VAL_DUMMY_G_FUNC_NAME VARCHAR2 ( 30 ) := MIG_ORA_EXT.MIG_FN_GET_PKG_VARIABLE ( current_schema ( )
---
BEGIN
---
RETURN l_func_name ;
END ;</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p19511272317">SCRIPTS: SAD_CALC_ITEM_PKG_TEST_OB.sql, SAD_CALC_ITEM_PRI_TEST_OB.sql</p>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p19518271030"><strong id="EN-US_TOPIC_0000001234200593__b513982917517">INPUT </strong>:</p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_screen10495151573617">CREATE OR REPLACE PACKAGE BODY "SAD"."SAD_CALC_ITEM_PKG_TEST_OB" IS
PROCEDURE back_sad_cost_line_t(pi_contract_number IN VARCHAR2,
pi_quotation_id IN NUMBER,
pi_product_code IN VARCHAR2,
pi_process_batch_number IN NUMBER,
po_error_msg OUT VARCHAR2) IS
BEGIN
---
LOOP
INSERT INTO sad_cost_line_bak
(processing_batch_number,
contract_number,
product_code,
quotation_id,
item_code,
refresh_date,
split_date,
error_msg,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES
(pi_process_batch_number,
cur_1.contract_number,
cur_1.product_code,
cur_1.quotation_id,
cur_1.item_code,
cur_1.refresh_date,
cur_1.split_date,
cur_1.error_msg,
cur_1.created_by,
cur_1.creation_date,
cur_1.last_updated_by,
cur_1.last_update_date);
END LOOP;
---
WHEN OTHERS THEN
po_error_msg := 'Others Exception raise in ' || func_name || ',' || SQLERRM;
END back_sad_cost_line_t;
END SAD_CALC_ITEM_PKG_TEST_OB;</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p13962272312"><strong id="EN-US_TOPIC_0000001234200593__b376818441516">OUTPUT </strong>:</p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_screen1357753883619">CREATE
OR REPLACE PROCEDURE SAD.SAD_CALC_ITEM_PKG_TEST_OB#back_sad_cost_line_t ( pi_contract_number IN VARCHAR2
,pi_quotation_id IN NUMBER
,pi_product_code IN VARCHAR2
,pi_process_batch_number IN NUMBER
,po_error_msg OUT VARCHAR2 ) IS MIG_PV_VAL_DUMMY_G_FUNC_NAME VARCHAR2 ( 30 ) := MIG_ORA_EXT.MIG_FN_GET_PKG_VARIABLE ( current_schema ( )
,'SAD_CALC_ITEM_PKG_TEST_OB'
,'g_func_name' ) ::VARCHAR2 ( 30 ) ;
ex_data_error
EXCEPTION ;
ex_prog_error
EXCEPTION ;
BEGIN
---
LOOP
INSERT INTO sad_cost_line_bak (
processing_batch_number
,contract_number
,product_code
,quotation_id
,item_code
,refresh_date
,split_date
,SAD.SAD_CALC_ITEM_PKG_TEST_OB#error_msg ( )
,created_by
,creation_date
,last_updated_by
,last_update_date
)
VALUES ( pi_process_batch_number ,cur_1.contract_number ,cur_1.product_code ,cur_1.quotation_id ,cur_1.item_code ,cur_1.refresh_date ,cur_1.split_date ,cur_1.error_msg ,cur_1.created_by ,cur_1.creation_date ,cur_1.last_updated_by ,cur_1.last_update_date ) ;
END LOOP ;
---
WHEN OTHERS THEN
po_error_msg := 'Others Exception raise in ' || SAD.SAD_CALC_ITEM_PKG_TEST_OB#func_name ( ) || ',' || SQLERRM ;
END ;</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p5445339636"><strong id="EN-US_TOPIC_0000001234200593__b9512185215517">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_screen203343519319">CREATE OR REPLACE PACKAGE BODY SAD.bas_dml_lookup_pkg IS
g_pkg_name CONSTANT VARCHAR2(30) := 'bas_dml_ic_price_rule_pkg' ;
g_func_name VARCHAR2(100);
FUNCTION func_name
RETURN VARCHAR2
IS
l_func_name VARCHAR2(100) ;
BEGIN
l_func_name := g_pkg_name || '.' || g_func_name ;
RETURN l_func_name ;
END ;
PROCEDURE data_change_logs ( pi_table_name IN VARCHAR2
, pi_table_key_columns IN VARCHAR2
, po_error_msg OUT VARCHAR2
)
IS
BEGIN
g_func_name := 'insert_fnd_data_change_logs_t';
INSERT INTO fnd_data_change_logs_t
( logid, table_name, table_key_columns )
VALUES
( fnd_data_change_logs_t_s.NEXTVAL
, pi_table_name, pi_table_key_columns );
EXCEPTION
WHEN OTHERS THEN
po_error_msg := 'Others Exception raise in ' || func_name || ',' || SQLERRM;
END data_change_logs;
END bas_dml_lookup_pkg;
/</pre>
<p id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_p10236135084620"><strong id="EN-US_TOPIC_0000001234200593__b15753165135212">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234200593__en-us_topic_0238518402_en-us_topic_0237362234_en-us_topic_0202727173_screen74057231415">CREATE OR REPLACE FUNCTION SAD.bas_dml_lookup_pkg#func_name
RETURN VARCHAR2
IS
MIG_PV_VAL_DUMMY_G_PKG_NAME VARCHAR2(30) := MIG_ORA_EXT.MIG_FN_GET_PKG_VARIABLE ( 'SAD', 'BAS_DML_LOOKUP_PKG', 'G_PKG_NAME' )::VARCHAR2(30) ;
MIG_PV_VAL_DUMMY_G_FUNC_NAME VARCHAR2(100) := MIG_ORA_EXT.MIG_FN_GET_PKG_VARIABLE ( 'SAD', 'BAS_DML_LOOKUP_PKG', 'G_FUNC_NAME' )::VARCHAR2(100) ;
l_func_name VARCHAR2(100) ;
BEGIN
l_func_name := MIG_PV_VAL_DUMMY_G_PKG_NAME || '.' || MIG_PV_VAL_DUMMY_G_FUNC_NAME ;
RETURN l_func_name ;
END ;
/
CREATE OR REPLACE PROCEDURE SAD.bas_dml_lookup_pkg#data_change_logs ( pi_table_name IN VARCHAR2
, pi_table_key_columns IN VARCHAR2
, po_error_msg OUT VARCHAR2 )
IS
MIG_PV_VAL_DUMMY_G_FUNC_NAME VARCHAR2(30) := MIG_ORA_EXT.MIG_FN_GET_PKG_VARIABLE ( 'SAD' ,'BAS_DML_LOOKUP_PKG' ,'G_FUNC_NAME' )::VARCHAR2(30) ;
BEGIN
MIG_PV_VAL_DUMMY_G_FUNC_NAME := 'insert_fnd_data_change_logs_t' ;
INSERT INTO fnd_data_change_logs_t (
logid,table_name,table_key_columns )
VALUES ( NEXTVAL ( 'fnd_data_change_logs_t_s' )
, pi_table_name, pi_table_key_columns ) ;
MIG_ORA_EXT.MIG_FN_SET_PKG_VARIABLE ( 'SAD', 'BAS_DML_LOOKUP_PKG', 'G_FUNC_NAME', MIG_PV_VAL_DUMMY_G_FUNC_NAME ) ;
EXCEPTION
WHEN OTHERS THEN
po_error_msg := 'Others Exception raise in ' || SAD.bas_dml_lookup_pkg#func_name( ) || ',' || SQLERRM ;
MIG_ORA_EXT.MIG_FN_SET_PKG_VARIABLE ( 'SAD', 'BAS_DML_LOOKUP_PKG', 'G_FUNC_NAME', MIG_PV_VAL_DUMMY_G_FUNC_NAME ) ;
END ;
/</pre>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_mt_0104.html">Oracle Syntax Migration</a></div>
</div>
</div>