tag:blogger.com,1999:blog-56664926026511798722024-02-20T00:39:46.391+05:30Tips and Tricks in Oracle Advanced ConceptsAnonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-5666492602651179872.post-70779052734927748052017-12-12T02:41:00.000+05:302017-12-12T02:41:11.018+05:30Q: Achieving the row level least value along with its column name<b><u>You asked</u></b>: I need to have a query which will give me the smallest value in a table and the column containing it. Please note there can be any number of columns. All will be number data type.<br />
<br />
<b><u>We said</u></b>: This can be achieved by unpivoting the result set and then group them to find their minimum value as shown below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtJH34nrzrcW1LZKN8uPHiv0N0AdvRc-p2UOJ5sDT43Fw_mxnmrbntW3C_mmlyJG5LgIOOnSWgVL9hfGra2bvBDa0gfOPpH8ncnW9le1TEqy2b8C_lUKbD9IZDrNz5IdgxBKPSJ4HKwDVw/s1600/FB_IMG_1513025963948.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="890" data-original-width="960" height="592" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtJH34nrzrcW1LZKN8uPHiv0N0AdvRc-p2UOJ5sDT43Fw_mxnmrbntW3C_mmlyJG5LgIOOnSWgVL9hfGra2bvBDa0gfOPpH8ncnW9le1TEqy2b8C_lUKbD9IZDrNz5IdgxBKPSJ4HKwDVw/s640/FB_IMG_1513025963948.jpg" width="640" /></a></div>
<span id="goog_582463681"></span><span id="goog_582463682"></span><br />Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-50058845590270027162017-11-05T00:28:00.000+05:302017-11-05T01:18:56.333+05:30Implicit conversion of Cursor FOR LOOP into BULK FETCH using the PLSQL_OPTIMIZE_LEVEL parameterPrior to the Oracle version 10gR1, the PL/SQL compiler does not apply any changes to the PL/SQL unit to improve their performance while translating them to the system code. From and after the release 10gR1, Oracle has introduced the initialization parameter PLSQL_OPTIMIZE_LEVEL to instruct the PL/SQL optimizer to automatically rearrange the source code, remove redundant and unreachable code, transform the FOR loops to Bulk Collect, and inline the subroutines for better performance.<br />
<br />
The PL/SQL optimizer performs the optimization techniques based on the level value that is set for the PLSQL_OPTIMIZE_LEVEL parameter. The possible values allowed for this parameter are 0, 1, 2 (Default), 3 (11g and higher only). The higher the value set for this parameter, the more the effort the PL/SQL optimizer makes to optimize the PL/SQL units.<br />
<br />
The prototype of the PLSQL_OPTIMIZE_LEVEL initialization parameter is shown below,<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">plsql_optimize_level</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">=<</span><span style="font-family: "courier new"; font-size: 13.3333px;">0</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;">1</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;">2</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;">3</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">></span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span></div>
</div>
<br />
Where, 2 is the default.<br />
<br />
<b><span style="font-size: large;">Altering the Optimization Level</span></b><br />
<br />
The PL/SQL optimization level can be set/altered using the PLSQL_OPTIMIZE_LEVEL initialization parameter either at the SYSTEM or SESSION or at the OBJECT level.<br />
<br />
The prototype for setting the optimization level either at the SYSTEM or SESSION level is shown below,<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="font-family: "courier new"; font-size: 13.3333px;">ALTER </span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;"><</span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">SYSTEM</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">SESSION</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">></span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">SET</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">plsql_optimize_level</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">=<</span><span style="font-family: "courier new"; font-size: 13.3333px;">0</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;">1</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;">2</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;">3</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">></span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span></div>
</div>
<br />
The prototype for setting the optimization at the object level is shown below,<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="font-family: "courier new"; font-size: 13.3333px;">ALTER </span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;"><</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">object_type</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">></span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;"><</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">object_name</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">></span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">COMPILE</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">plsql_optimize_level</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">=</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;"><</span><span style="font-family: "courier new"; font-size: 13.3333px;">0</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;">1</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;">2</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">|</span><span style="font-family: "courier new"; font-size: 13.3333px;">3</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">></span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span></div>
</div>
<br />
If the object is recompiled without the REUSE SETTINGS clause, it takes the database’s current optimization level as its own. With this clause included in the compilation script, the object retains the optimization level it was last compiled with, instead of the database’s current optimization level.<br />
<br />
Consider the test procedure for the further demonstration of the PLSQL_OPTIMIZE_LEVEL parameter for the implicit conversion of LOOPs into BULK FETCHes.<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">CREATE</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">OR</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">replace</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">PROCEDURE</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: #ff0080; font-family: "courier new"; font-size: 13.3333px;"><b>Proc_test</b></span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">authid</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">current_user</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">IS</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_start_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>PLS_INTEGER</i></span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_end_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>PLS_INTEGER</i></span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_cpu_start_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>PLS_INTEGER</i></span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_cpu_end_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>PLS_INTEGER</i></span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_var1</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>PLS_INTEGER</i></span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_var2</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>PLS_INTEGER</i></span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">FUNCTION</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: #ff0080; font-family: "courier new"; font-size: 13.3333px;"><b>Func_test</b></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">ip_pi_var1</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>PLS_INTEGER</i></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">RETURN</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>PLS_INTEGER</i></span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">IS</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">BEGIN</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">RETURN</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">ip_pi_var1</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">+</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">ip_pi_var1</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">END</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">BEGIN</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_start_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">NULL</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_cpu_start_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">NULL</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_start_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_utility</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">get_time</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_cpu_start_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_utility</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">get_cpu_time</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">FOR</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">i</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">IN</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">SELECT</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">object_name</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">FROM</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dba_objects</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">LOOP</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">NULL</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">END</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">LOOP</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">i</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">FOR</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">j</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">IN</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">SELECT</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">table_name</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">,</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">column_name</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">FROM</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dba_tab_cols</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">LOOP</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_var2</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="font-family: "courier new"; font-size: 13.3333px;">0</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_var2</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="font-family: "courier new"; font-size: 13.3333px;">1</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">END</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">LOOP</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">j</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_var2</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="color: #ff0080; font-family: "courier new"; font-size: 13.3333px;"><b>Func_test</b></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="font-family: "courier new"; font-size: 13.3333px;">10</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">IF</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;">1</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">=</span><span style="font-family: "courier new"; font-size: 13.3333px;">1</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">THEN</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_var2</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="font-family: "courier new"; font-size: 13.3333px;">100</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">ELSE</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_var2</span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="font-family: "courier new"; font-size: 13.3333px;">1000</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">END</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">IF</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">NULL</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_end_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_utility</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">get_time</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_cpu_end_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_utility</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">get_cpu_time</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_output</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">put_line</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'Program run time: '</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> ||</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_end_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_start_time</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">/</span><span style="font-family: "courier new"; font-size: 13.3333px;">100</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> ||</span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">' Seconds'</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_output</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">put_line</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'CPU run time: '</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> ||</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_cpu_end_time</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_cpu_start_time</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">/</span><span style="font-family: "courier new"; font-size: 13.3333px;">100</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> ||</span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">' Seconds'</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">END</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><br />
<span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">/</span></div>
</div>
<br />
After the procedure is created, its compilation mode can be verified by querying the USER_PLSQL_OBJECT_SETTINGS data dictionary table as shown below,<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">SELECT</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">name</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">,</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">TYPE</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">,</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">plsql_optimize_level</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">FROM</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">user_plsql_object_settings</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">WHERE</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">name</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">=</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'PROC_TEST'</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span></div>
</div>
<br />
NAME TYPE PLSQL_OPTIMIZE_LEVEL<br />
---------------- ------------------ ------------------------------------<br />
PROC_TEST PROCEDURE 2<br />
<br />
<u>Note</u>: The default optimization level for the procedure will be the database’s current optimization level.<br />
<br />
The PLSQL_OPTIMIZE_LEVEL=2 setting performs the below implicit actions on the package.<br />
<br />
<ol>
<li><b>Redundant code removal</b></li>
<ol>
<li>The null assignment to the variables, L_PI_START_TIME and L_PI_CPU_START_TIME in the line numbers 16 and 17 respectively, are already null during their creation in the declaration section, thus making these two statements redundant.</li>
<li>The statements L_PI_VAR2=0 and L_PI_VAR2=1 are redundant as it assigns a literal integer for every iteration inside the loop. Also, the assignment of the first statement is overridden by the second statement. The PL/SQL compiler finds these properties, takes the first statement (L_PI_VAR2=0) out of the loop structure and skips the second statement (L_PI_VAR2=1) during the program execution.</li>
</ol>
<li><b>Unreachable code removal</b></li>
<ol>
<li>The statement l_pi_var2:=1000; is unreachable in the code and this will be avoided.</li>
</ol>
<li><b>Implicit conversion of Cursor FOR LOOP into BULK ARRAY FETCH.</b></li>
<ol>
<li>This setting along with NCOMP mode (PLSQL_CODE_TYPE=NATIVE) converts all the FOR loops into ARRAY fetches with a limit of 100. let us compare the result of the trace file output for the above package with PLSQL_OPTIMIZE_LEVEL>=2 and PLSQL_OPTIMIZE_LEVEL<=1 settings respectively.</li>
</ol>
</ol>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjieYUj67RTB2l-AhrhzCKCcpCaoP7BrQlclw3EU9290QPCkCckr6BjgSlV6xyRhujIBeNRpW4jkNH2mYOibCLAuYEINvtEW5o4ASB_2h8PR82gxjFxkI7YA8SYaBIQekahAzlEfBxi3vPq/s1600/img1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="161" data-original-width="571" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjieYUj67RTB2l-AhrhzCKCcpCaoP7BrQlclw3EU9290QPCkCckr6BjgSlV6xyRhujIBeNRpW4jkNH2mYOibCLAuYEINvtEW5o4ASB_2h8PR82gxjFxkI7YA8SYaBIQekahAzlEfBxi3vPq/s640/img1.jpg" width="640" /></a></div>
<br />
The above trace file output is extracted when the procedure code was executed with the PLSQL_OPTIMIZE_LEVEL parameter value set to <=1. The total number of rows processed is 2,24,208 and the total fetch operations performed is 2,24,214. This indicates that approximately 1 row is fetched for each fetch operation, resulting in CPU overhead and context switching.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQfyqq-02qKIQ6dPVXw0aP0AKvFKVx17FEz-yle5ApmGOqeRQMzNAzAX8QcpaKpyM269qeWwy9fxvPO8Fh_bfI5g4EyZlp49B4t1PoNrJzAHamiHI1gXYyI24Z9mySc0G8lK21DaPcT1Bw/s1600/img2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="161" data-original-width="595" height="172" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQfyqq-02qKIQ6dPVXw0aP0AKvFKVx17FEz-yle5ApmGOqeRQMzNAzAX8QcpaKpyM269qeWwy9fxvPO8Fh_bfI5g4EyZlp49B4t1PoNrJzAHamiHI1gXYyI24Z9mySc0G8lK21DaPcT1Bw/s640/img2.jpg" width="640" /></a></div>
<br />
The above trace file output is extracted when the procedure code was executed with the PLSQL_OPTIMIZE_LEVEL parameter value set to >=2 in the NCOMP mode (PLSQL_CODE_TYPE=NATIVE). The total number of rows processed is 2,24,208 and the total fetches performed is 2,247. This shows that the recursive statements are implicitly converted into ARRAY fetches with a limit of 100.<br />
<br />
This approach automatically reduces the context switching and increases the performance of the package.<br />
<br />
<br />
Thank you,<br />
Boobal Ganesan<br />
Author of <a href="http://www.rampant-books.com/book_1701_plsql_definitive_ref.htm">Advanced PL/SQL Programming - The Definitive Reference</a><br />
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-21841554188037079812017-10-11T03:22:00.004+05:302017-10-11T12:51:35.887+05:30Neat trick to encrypt your PL/SQL subprograms and still be able to execute it!We have encrypted our data while storing it in the database, but have we ever tried to encrypt our PL/SQL subprograms while creating them? There are scenarios where we must hide our code from our client for few reasons like stopping anyone from reading and then recreating our code, and much more.<br />
<br />
There is an Oracle provided utility to achieve this task, that is the Oracle's WRAP utility. The WRAP utility doesn't encrypt our code but just obfuscates it. Here is an example,<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: x-small;">CREATE</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">OR</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">replace</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">PROCEDURE</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>Proc_wrap</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">ip_date</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="font-family: "courier new"; font-size: x-small;"><i>DATE</i></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: x-small;">IS</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: x-small;">BEGIN</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_output</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>Put_line</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: red; font-family: "courier new"; font-size: x-small;">'The input date is '</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> ||</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">ip_date</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: x-small;">END</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><br />
<span style="color: silver; font-family: "courier new"; font-size: x-small;">/</span><span style="font-family: "courier new"; font-size: x-small;"> </span></div>
</div>
<br />
Consider that we have planned to make the procedure unreadable to anybody who tries to understand it. For this scenario we can use the WRAP utility in Oracle to get this done as below,<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: x-small;">SELECT</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_ddl</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">wrap</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(q</span><span style="color: red; font-family: "courier new"; font-size: x-small;">'[CREATE OR REPLACE PROCEDURE proc_encrypt( ip_date DATE) IS BEGIN dbms_output.put_line('</span><span style="color: red; font-family: "courier new"; font-size: x-small;">the input DATE IS </span><span style="color: red; font-family: "courier new"; font-size: x-small;">'||ip_date); END; /]'</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: x-small;">FROM</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dual</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span></div>
</div>
<br />
The above SELECT query returns the obfuscated form of this PROC_WRAP procedure as below,<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">CREATE</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">OR</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">REPLACE</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">PROCEDURE</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">proc_encrypt</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">wrapped</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">a000000</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">b2</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">abcd</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;">7</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;">71</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">ae</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">g10MIi6Tv0Y9j0IvM3mHKN7UxXIwg5nnm7</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">+</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">fMr2ywFwWFpeuSq7XDNHlVhazaabh0XKpMB</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">/</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">G</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">L</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">+</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">pEL2v6Q4hHQ138uSlbibhSm7JK</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">/</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">iiyveeysx0GMCyuJOqygchfwwJHNKwl0wKJ29PKA1Q1</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;">7</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">eg5J0DoKpwKT20qnCIdpgxFynY</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">=</span></div>
</div>
<br />
This obfuscated procedure can be still executed just like a normal procedure.<br />
<br />
But wait! Can we Unwrap this obfuscated script to its readable format? The answer is YES!!<br />
<br />
There are lots of online utilities like <a href="https://www.codecrete.net/UnwrapIt/">codecrete.net</a>, which does the job. So, this is not the most efficient way to hide our code.<br />
<br />
While thinking of a better approach, I tumbled upon the DBMS_CRYPTO package.<br />
<br />
Now, what is the DBMS_CRYPTO package and what is it used for?<br />
<br />
The DBMS_CRYPTO package encrypts and decrypts messages and was introduced to replace the DBMS_OBFUSCATION_TOOLKIT package by providing support for a range of new secure algorithms with easy usage. The algorithms 3DES_2KEY and MD4 are only provided for backward compatibility and the algorithms 3DES, AES, MD-5, SHA-1, and SHA-2 provide more security compared to them.<br />
<br />
The DBMS_CRYPTO package consists of ENCRYPT and DECRYPT subprograms for encrypting and decrypting the string messages respectively.<br />
<br />
The prototype of the ENCRYPT and the DECRYPT functions in this package are shown below,<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<div>
<span style="font-family: "courier new"; font-size: 10pt;">DBMS_CRYPTO<span style="color: silver;">.</span><span style="color: maroon;">ENCRYPT</span><span style="color: maroon;">(</span> <span style="color: maroon;">src</span> <span style="color: blue;">IN</span> <span style="color: blue;">RAW</span><span style="color: silver;">,</span> <span style="color: maroon;">typ</span> <span style="color: blue;">IN</span> <span style="color: maroon;">PLS_INTEGER</span><span style="color: silver;">,</span> <span style="color: blue;">KEY</span> <span style="color: blue;">IN</span> <span style="color: blue;">RAW</span><span style="color: silver;">,</span> <span style="color: maroon;">iv</span> <span style="color: blue;">IN</span> <span style="color: blue;">RAW</span> <span style="color: blue;">DEFAULT</span> <span style="color: blue;">NULL</span><span style="color: maroon;">)</span><br /><span style="color: blue;">RETURN</span> <span style="color: blue;">RAW</span><span style="color: silver;">;</span></span></div>
<div>
<span style="font-family: "courier new"; font-size: 10pt;"><br /></span></div>
<div>
<span style="font-family: "courier new"; font-size: 10pt;">DBMS_CRYPTO<span style="color: silver;">.</span><span style="color: maroon;">DECRYPT</span><span style="color: maroon;">(</span> <span style="color: maroon;">src</span> <span style="color: blue;">IN</span> <span style="color: blue;">RAW</span><span style="color: silver;">,</span> <span style="color: maroon;">typ</span> <span style="color: blue;">IN</span> <span style="color: maroon;">PLS_INTEGER</span><span style="color: silver;">,</span> <span style="color: blue;">KEY</span> <span style="color: blue;">IN</span> <span style="color: blue;">RAW</span><span style="color: silver;">,</span> <span style="color: maroon;">iv</span> <span style="color: blue;">IN</span> <span style="color: blue;">RAW</span> <span style="color: blue;">DEFAULT</span> <span style="color: blue;">NULL</span><span style="color: maroon;">)</span><br /><span style="color: blue;">RETURN</span> <span style="color: blue;">RAW</span><span style="color: silver;">;</span></span></div>
</div>
</div>
<br />
<ul>
<li><b>SRC</b> parameter accepts RAW and LOB input data for the encryption for the overloaded function and the procedures respectively.</li>
<li><b>TYP</b> parameter accepts the stream or block ciphers and the modifiers to be used. </li>
<li><b>KEY</b> parameter accepts the encryption key used by the user for the encryption process. </li>
<li><b>IV</b> parameter is also called as the initialization vector. This is for the block ciphers. The default is Null.</li>
</ul>
<br />
<div>
Now, consider the above same PROC_WRAP procedure for the encryption process. As a initial step, we must encrypt it using the below block. Note that the procedure is forward declared inside an anonymous block and this block is encrypted as shown below,</div>
<div>
<br /></div>
<div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">DECLARE</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_vc_input_string</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>clob</i></span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="font-family: "courier new"; font-size: 13.3333px;"> q</span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'[DECLARE PROCEDURE proc_encrypt( ip_date DATE) IS BEGIN dbms_output.put_line('The input date is '||ip_date); END; BEGIN proc_encrypt(sysdate); END;]'</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_rw_encryption_key</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>raw</i></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="font-family: "courier new"; font-size: 13.3333px;">32</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_rw_encrypted_string</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>raw</i></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="font-family: "courier new"; font-size: 13.3333px;">32767</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_encryption_type</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="font-family: "courier new"; font-size: 13.3333px;"><i>pls_integer</i></span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">DBMS_CRYPTO</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">ENCRYPT_AES256</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">+</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">DBMS_CRYPTO</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">CHAIN_CBC</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">+</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">DBMS_CRYPTO</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">PAD_PKCS5</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"></span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">BEGIN</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_rw_encryption_key</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_crypto</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: 13.3333px;"><b>randombytes</b></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="font-family: "courier new"; font-size: 13.3333px;">32</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_rw_encrypted_string</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">:=</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">DBMS_CRYPTO</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: 13.3333px;"><b>ENCRYPT</b></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">UTL_I18N</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: 13.3333px;"><b>STRING_TO_RAW</b></span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_vc_input_string</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">,</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'AL32UTF8'</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">,</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_pi_encryption_type</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">,</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_rw_encryption_key</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"></span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_output</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: 13.3333px;"><b>put_line</b></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'Input string before encryption=> '</span><span style="font-family: "courier new"; font-size: 13.3333px;">||</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_vc_input_string</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_output</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: 13.3333px;"><b>put_line</b></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'Encryption Key=> '</span><span style="font-family: "courier new"; font-size: 13.3333px;">||</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_rw_encryption_key</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">dbms_output</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: 13.3333px;"><b>put_line</b></span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'Encrypted Script=> '</span><span style="font-family: "courier new"; font-size: 13.3333px;">||</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">l_rw_encrypted_string</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: 13.3333px;">END</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span><br />
<span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">/</span></div>
</div>
<br />
<ul></ul>
</div>
<div>
<div>
<b>Input string before encryption</b>=> DECLARE</div>
<div>
PROCEDURE proc_encrypt(</div>
<div>
ip_date DATE)</div>
<div>
IS</div>
<div>
BEGIN</div>
<div>
dbms_output.put_line('The input date is '||ip_date);</div>
<div>
END;</div>
<div>
BEGIN</div>
<div>
proc_encrypt(sysdate);</div>
<div>
END;</div>
<div>
<br /></div>
<div>
<b>Encryption Key</b>=> B3012F6470338E0DE91E47B219E175593919CFC41FC5A50E7FD1D768034CD813</div>
<div>
<br /></div>
<div>
<b>Encrypted Script</b>=> A5B2FDEA81B528B5546A11A51EB5368DC750AA8B4E671E62CD977AD4203923E451131934E2BBE11981D75B9BC8F3AF65160F22A6018839C6E48E8FB70C273515A76D67ACD3081FD23BE0D671A93B19CC61DE0DC37E41B7607EABB41DF8397F0D540257B3196071468CEBE0B0F5353F57D8F8B1273F1DC8643F3347B159E5E9F6C1C6A769426F5FE8E3F3BEF8AE5241CF5E67FC33735F30777EB1C0DD231A4909</div>
<div>
<br /></div>
</div>
<div>
Here, we have generated the KEY randomly of 32 bytes using the DBMS_CRYPTO.RANDOMBYTES function.</div>
<div>
<br /></div>
<div>
After getting the encrypted form of the procedure, we must create our "client facing procedure" as like below,</div>
<div>
<br /></div>
<div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<div>
<span style="font-family: "courier new"; font-size: 10pt;"><span style="color: blue;">CREATE</span> <span style="color: blue;">OR</span> <span style="color: maroon;">REPLACE</span> <span style="color: blue;">PROCEDURE</span> <span style="color: #ff0080;"><b>proc_test</b></span><span style="color: maroon;">(</span><br /> <span style="color: maroon;">ip_rw_encryption_key</span> <span style="color: black;"><i>raw</i></span><span style="color: maroon;">)</span><br /><span style="color: blue;">IS</span><br /> <span style="color: maroon;">l_vc_encrypted_code</span> <span style="color: black;"><i>VARCHAR2</i></span><span style="color: maroon;">(</span><span style="color: black;">32767</span><span style="color: maroon;">)</span><span style="color: blue;">:=</span><span style="color: red;">'750C744D1CCC6380303EACCD0A9ED8805980C9F3FFDA6EC67688396E1DDDFC87D2B8055E9A9256EF1DD4FAED42AC13569C25FFBE260107AF060651B7836E75E2CC20C19BE8E5AFE3F46FCA37BE0A62EAE0B3B15241D60B11A1E40C3F80A9A4DA6A575614B1BB4AF98A222919D1D654996D4567F475D99FD53021433A3940A38AE7F14B7C0EA4C374956D1BBDDA5C6145C1E0B000FFCF1622F3250160EC721C65'</span><span style="color: silver;">;</span><br /> <span style="color: maroon;">l_pi_encryption_type</span> <span style="color: black;"><i>pls_integer</i></span> <span style="color: blue;">:=</span><span style="color: maroon;">DBMS_CRYPTO</span><span style="color: silver;">.</span><span style="color: maroon;">ENCRYPT_AES256</span><span style="color: silver;">+</span> <span style="color: maroon;">DBMS_CRYPTO</span><span style="color: silver;">.</span><span style="color: maroon;">CHAIN_CBC</span><span style="color: silver;">+</span> <span style="color: maroon;">DBMS_CRYPTO</span><span style="color: silver;">.</span><span style="color: maroon;">PAD_PKCS5</span><span style="color: silver;">;</span><br /><span style="color: blue;">BEGIN</span><br /> <span style="color: blue;">EXECUTE</span> <span style="color: blue;">immediate</span> <span style="color: maroon;">UTL_I18N</span><span style="color: silver;">.</span><span style="color: #ff0080;"><b>RAW_TO_CHAR</b></span><span style="color: maroon;">(</span><span style="color: maroon;">DBMS_CRYPTO</span><span style="color: silver;">.</span><span style="color: #ff0080;"><b>DECRYPT</b></span><span style="color: maroon;">(</span><span style="color: maroon;">l_vc_encrypted_code</span><span style="color: silver;">,</span> <span style="color: maroon;">l_pi_encryption_type</span><span style="color: silver;">,</span> <span style="color: maroon;">ip_rw_encryption_key</span><span style="color: maroon;">)</span><span style="color: silver;">,</span> <span style="color: red;">'AL32UTF8'</span><span style="color: maroon;">)</span><span style="color: silver;">;</span><br /><span style="color: blue;">END</span><span style="color: silver;">;</span></span></div>
<div>
<span style="font-family: "courier new"; font-size: 10pt;"><span style="color: silver;">/</span></span></div>
</div>
</div>
</div>
<br />
The above procedure just decrypts our encrypted message and then executes it using the EXECUTE IMMEDIATE clause, considering it as a dynamic code. Not everyone can decrypt and run the procedure successfully as the KEY which is used for encryption is required for the decryption also and this KEY is to be passed as input to the procedure.<br />
<br />
If the KEY is wrong, the procedure exits with an error as below,<br />
<br />
<div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">EXEC</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">proc_test</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'ABCDEFFBE508071AA1EC5FF4D301A5DF12572742BCA5420C78B2'</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span></div>
</div>
</div>
<br />
<b> Error report</b> -<br />
ORA-28234: key length too short<br />
ORA-06512: at "SYS.DBMS_CRYPTO_FFI", line 67<br />
ORA-06512: at "SYS.DBMS_CRYPTO", line 44<br />
ORA-06512: at "SYS.PROC_TEST", line 7<br />
ORA-06512: at line 1<br />
28234. 00000 - "key length too short"<br />
<br />
When we execute the procedure with the right KEY,<br />
<br />
<div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">EXEC</span><span style="font-family: "courier new"; font-size: 13.3333px;"> </span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">proc_test</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">(</span><span style="color: red; font-family: "courier new"; font-size: 13.3333px;">'6A0B656248D9955AEEFBE508071AA1EC5FF4D301A5DF12572742BCA5420C78B2'</span><span style="color: maroon; font-family: "courier new"; font-size: 13.3333px;">)</span><span style="color: silver; font-family: "courier new"; font-size: 13.3333px;">;</span></div>
</div>
</div>
<br />
<b>Result:</b><br />
The input date is 10-OCT-17<br />
<div>
<br /></div>
<div>
Thus, with this trick, we have made sure that our PL/SQL code is unreadable and can be accessed only if we have the right KEY.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Thank you,</div>
<div>
Boobal Ganesan</div>
<div>
Author of <a href="http://www.rampant-books.com/book_1701_plsql_definitive_ref.htm">Advanced PL/SQL Programming - The Definitive Reference</a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-61228525131855868492017-09-10T00:09:00.000+05:302017-09-12T01:35:28.780+05:30Duplication check on a BLOB column containing image files<html>
<head>
<meta name="google-site-verification" content="JGuCG2D2yGJ4fdKIC5U25ryGdFzky9vE1YULIIzD7FI" />
<title> My title </title>
</head>
<body>
<div dir="ltr" style="text-align: left;" trbidi="on">
We can store multimedia files like music, image, or video files either inside the database (BLOB type) or outside the database (BFILE type).<br />
<br />
<b><u>BLOB:</u></b><br />
<br />
The BLOB datatypes are read-write binary large datatypes, that lets us store large binary files like video, audio, and PDF documents in the database. The maximum size of these types can range from 8 TB to 128 TB based on the DB_BLOCK_SIZE initialization parameter, which is set during the database creation in the init.ora file. The formula for calculating the maximum size of the LOB type is (4 GB - 1) * DB_BLOCK_SIZE value. Once this parameter is set, there is no going back for any change except for re-creating the database. The maximum value that can be set for the DB_BLOCK_SIZE parameter is 16 KB for Linux X86 environments and 32 KB for other environments. However, setting this parameter’s value to its maximum may affect the I/O operations.<br />
<br />
<b><u>BFILE: Binary File</u></b><br />
<br />
BFILE is a read-only datatype that the database uses to access external binary files with a maximum size limit of 4 GB. Even though the BFILE and the BLOB types intends to store binary data, they both work differently from each other. Both the BFILE and BLOB column stores only the locators which point to the actual data that resides outside the ROW, but the BLOB type stores its binary data inside the database whereas the BFILE type stores its data outside the database in the OS layer. The BFILE type is capable of storing external binary files which can be in PDF, GIF, JPEG, MPEG, MPEG2, text, or other formats.<br />
<br />
<u>Note</u>: The External LOB type doesn’t support UPDATE or DELETE operations as they are READ-ONLY.<br />
<br />
Consider the below example for creating a table which holds a sequence number and a BLOB column to hold image files.<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; color: #222222; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: x-small;">CREATE</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">TABLE</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">mytable</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">seq</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: black; font-family: "courier new"; font-size: x-small;"><i>NUMBER</i></span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">image_file</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: black; font-family: "courier new"; font-size: x-small;"><i>BLOB</i></span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span></div>
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="font-family: "courier new"; font-size: x-small;">/</span></div>
</div>
<br />
When we want to maintain uniqueness for a non-LOB column, we can either create an unique index, primary key (which by default creates an unique index), or an unique key (which by default creates an unique index).<br />
<br />
Can we also create a similar unique index, primary key or an unique key for a LOB column?<br />
<br />
The answer is NO!<br />
<br />
Oracle does not allow us to create any of those for a LOB column. Let's check it out using the below examples.<br />
<div style="text-align: left;">
</div>
<ul style="text-align: left;">
<li>Creating an unique index on a LOB column</li>
</ul>
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; color: #222222; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: x-small;">CREATE</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">UNIQUE</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">INDEX</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">idx_image_file</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">ON</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">mytable</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">image_file</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span></div>
</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><b>Error report -</b>SQL Error: ORA-02327: cannot create index on expression with datatype LOB<br />02327. 00000 - "cannot create index on expression with datatype %s"<br />*Cause: An attempt was made to create an index on a non-indexable<br /> expression.</span></div>
<div>
<ul style="text-align: left;">
<li>Creating a unique constraint on a LOB column</li>
</ul>
</div>
<div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; color: #222222; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: x-small;">ALTER</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">TABLE</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">mytable</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">ADD</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">CONSTRAINT</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">uk_image_file</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">UNIQUE</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">image_file</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span></div>
</div>
</div>
<br />
<span style="font-size: x-small;"><b>Error report -</b></span><br />
<span style="font-size: x-small;">SQL Error: ORA-02329: column of datatype LOB cannot be unique or a primary key</span><br />
<span style="font-size: x-small;">02329. 00000 - "column of datatype %s cannot be unique or a primary key"</span><br />
<span style="font-size: x-small;">*Cause: An attempt was made to place a UNIQUE or a PRIMARY KEY constraint</span><br />
<span style="font-size: x-small;"> on a column of datatype VARRAY, nested table, object, LOB, FILE</span><br />
<span style="font-size: x-small;"> or REF.</span><br />
<div>
<br /></div>
So, how can we achieve the uniqueness for a LOB column? There is a neat trick to do that.<br />
<br />
We can create another column to our table which can be used for holding the hash value of the image and check uniqueness for that column. The hash value is actually a compact numeric version of the image file which will be same for same input image. By checking uniqueness on this column, we can make sure that the image is not duplicated.<br />
<br />
Let's try this using the below examples.<br />
<br />
Firstly, we are adding a new column to our MYTABLE. This new column is a virtual column which will return the hash value of the IMAGE_FILE column.<br />
<br />
<div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; color: #222222; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: x-small;">ALTER</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">TABLE</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">mytable</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">ADD</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">hash_value</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">generated</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">always</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">AS</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span></div>
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: maroon; font-family: "courier new"; font-size: x-small;"> (</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_crypto</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">hash</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">image_file</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: black; font-family: "courier new"; font-size: x-small;">2</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: black; font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">virtual</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span></div>
</div>
</div>
<br />
The second parameter to the DBMS_CRYPTO.HASH function accepts any of the below hash functions.<br />
<br />
<ul style="text-align: left;">
<li>HASH_MD4 = 1</li>
<li>HASH_MD5 = 2</li>
<li>HASH_SH1 = 3</li>
<li>HASH_SH256 = 4</li>
<li>HASH_SH384 = 5</li>
<li>HASH_SH512 = 6</li>
</ul>
<br />
After the column is added, we must create a unique index on this virtual column as below,<br />
<br />
<div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: x-small;">CREATE UNIQUE INDEX idx_hash_value ON mytable(hash_value);</span></div>
</div>
</div>
</div>
<br />
We must now create a directory object for the images' location as below,<br />
<br />
<div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="font-family: "courier new"; font-size: x-small;">CREATE </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">OR</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">replace</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">directory</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dir_pictures</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">AS</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: red; font-family: "courier new"; font-size: x-small;">'F:\Pictures'</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span></div>
</div>
</div>
</div>
<br />
Now, we are all set to insert the image file into our table using the below script.<br />
<br />
<div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: x-small;">DECLARE</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bf_src</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="font-family: "courier new"; font-size: x-small;"><i>BFILE</i></span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">:=</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>Bfilename</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: red; font-family: "courier new"; font-size: x-small;">'DIR_PICTURES'</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: red; font-family: "courier new"; font-size: x-small;">'Batman.JPG'</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bl_dest</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="font-family: "courier new"; font-size: x-small;"><i>BLOB</i></span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">:=</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>Empty_blob</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_i_src_offset</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="font-family: "courier new"; font-size: x-small;"><i>INTEGER</i></span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">:=</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="font-family: "courier new"; font-size: x-small;">1</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_i_dest_offset</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="font-family: "courier new"; font-size: x-small;"><i>INTEGER</i></span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">:=</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="font-family: "courier new"; font-size: x-small;">1</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: x-small;">BEGIN</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>Createtemporary</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bl_dest</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">TRUE</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: blue; font-family: "courier new"; font-size: x-small;">SESSION</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<br style="font-family: "Courier New"; font-size: small;" />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>OPEN</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bf_src</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">file_readonly</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<br style="font-family: "Courier New"; font-size: small;" />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>OPEN</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bl_dest</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">lob_readwrite</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<br style="font-family: "Courier New"; font-size: small;" />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>Loadblobfromfile</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bl_dest</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bf_src</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">lobmaxsize</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_i_dest_offset</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_i_src_offset</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<br style="font-family: "Courier New"; font-size: small;" />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">INSERT</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">INTO</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">mytable</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">seq</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">image_file</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: blue; font-family: "courier new"; font-size: x-small;">VALUES</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="font-family: "courier new"; font-size: x-small;">1</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">,</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bl_dest</span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span></div>
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "courier new"; font-size: x-small;">commit;</span></div>
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue;"><br style="font-family: "Courier New"; font-size: small;" /></span><span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_output</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>Put_line</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: red; font-family: "courier new"; font-size: x-small;">'Total size of the image file is '</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> ||</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>Getlength</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bl_dest</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="font-family: "courier new"; font-size: x-small;"> ||</span><span style="color: red; font-family: "courier new"; font-size: x-small;">' Bytes'</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<br style="font-family: "Courier New"; font-size: small;" />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>CLOSE</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bf_src</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<br style="font-family: "Courier New"; font-size: small;" />
<span style="font-family: "courier new"; font-size: x-small;"> </span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">dbms_lob</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "courier new"; font-size: x-small;"><b>CLOSE</b></span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">(</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">l_bl_dest</span><span style="color: maroon; font-family: "courier new"; font-size: x-small;">)</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: blue; font-family: "courier new"; font-size: x-small;">END</span><span style="color: silver; font-family: "courier new"; font-size: x-small;">;</span><span style="font-family: "courier new"; font-size: x-small;"> </span><br />
<span style="color: silver; font-family: "courier new"; font-size: x-small;">/</span><span style="font-family: "courier new"; font-size: x-small;"> </span></div>
</div>
</div>
</div>
<div style="background-color: #eefcff; border-bottom: 1pt dotted windowtext; border-image: initial; border-left: none; border-right: none; border-top: none; color: #222222; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; margin-left: 0.2in; margin-right: 0in; padding: 0in 0in 1pt;">
</div>
<br />
We can now check our image file using any IDE. I am currently using the SQL DEVELOPER 4.1.3 version for checking the inserted image file.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipT2M_FCpLK9TAk3BTCEVAU9m3uJ7cNqwPctRBhDjzXJujDiT79BgASfgFaFHWjtojBHSgJriP1LWIXSBImSEngVwKG5aFZbticatGjxYYD6vzm_BPvjFvGO2FQ9f4M5UitF113a6NaoAF/s1600/batman.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="505" data-original-width="455" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipT2M_FCpLK9TAk3BTCEVAU9m3uJ7cNqwPctRBhDjzXJujDiT79BgASfgFaFHWjtojBHSgJriP1LWIXSBImSEngVwKG5aFZbticatGjxYYD6vzm_BPvjFvGO2FQ9f4M5UitF113a6NaoAF/s320/batman.jpg" width="288" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Now, when we rerun the same PL/SQL block again to insert the same image, we get the below unique index violation.<br />
<br />
<span style="font-size: x-small;"><b>Error report -</b></span><br />
<span style="font-size: x-small;">ORA-00001: unique constraint (SYS.IDX_HASH_VALUE) violated</span><br />
<span style="font-size: x-small;">ORA-06512: at line 11</span><br />
<span style="font-size: x-small;">00001. 00000 - "unique constraint (%s.%s) violated"</span><br />
<span style="font-size: x-small;">*Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.</span><br />
<span style="font-size: x-small;"> For Trusted Oracle configured in DBMS MAC mode, you may see</span><br />
<span style="font-size: x-small;"> this message if a duplicate entry exists at a different level.</span><br />
<span style="font-size: x-small;">*Action: Either remove the unique restriction or do not insert the key.</span><br />
<div>
<br /></div>
We have found a workaround to check uniqueness on the LOB columns in this blog.<br />
<br />
<br />
Thank you,<br />
Boobal Ganesan<br />
<div style="background-color: #eefcff; border-bottom: 1pt dotted windowtext; border-image: initial; border-left: none; border-right: none; border-top: none; color: #222222; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; margin-left: 0.2in; margin-right: 0in; padding: 0in 0in 1pt;">
<div class="auto-style3" style="border-color: inherit; border-style: none; border-width: medium; font-family: "Arial Narrow", sans-serif; font-size: 11pt; font-weight: bold; margin: 6pt 0in 6pt 0.2in; padding: 0in; text-align: justify;">
<br /></div>
</div>
</div>
</body>
</html>Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-9309548434009719472017-09-01T00:41:00.001+05:302017-09-01T00:41:17.575+05:30Reducing Context Switching in Functions and Procedures <div dir="ltr" style="text-align: left;" trbidi="on">
When we mix SQL and PL/SQL together, we get context switches. That is, the control is switched from the SQL engine to the PL/SQL engine and vice versa. This impacts the database by increasing the number of CPU processes and the time of execution of the program code. Oracle 12c has introduced two new features to reduce the impact of context switching and maximizes the code inlining to increase the performance of the PL/SQL. They are, <br />
<br />
1) Functional and Procedural WITH clauses, and <br />
2) Pragma UDF compiler directive. <br />
<br />
The Functional and Procedural WITH clauses allows us to use the PL/SQL functions and procedures in SQL. Of course, we cannot call the procedure in SQL using the WITH clause, but we can call the procedure inside the function and call that function in SQL. These objects cannot be created, but only selected similarly to an SQL query. <br />
<br />
The Pragma UDF (User Defined Functions) directs the compiler that the function has to be prepared for execution in a SELECT statement to avoid context switching. Calling a function that is defined as UDF from PL/SQL might not provide any performance gain. <br />
<br />
For demonstration, two functions with and without the PRAGMA UDF clause in its declaration section respectively, are created for calculating the tax incurred on the employee’s corresponding salary.<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; color: #222222; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "Courier New"; font-size: x-small;">CREATE</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">OR</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">replace</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">FUNCTION</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: #ff0080; font-family: "Courier New"; font-size: x-small;"><b>Func_without_pragma</b></span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">ip_n_sal</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: black; font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">RETURN</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: black; font-family: "Courier New"; font-size: x-small;"><i>PLS_INTEGER</i></span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">IS</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">BEGIN</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">RETURN</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">ip_n_sal</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">*</span><span style="color: black; font-family: "Courier New"; font-size: x-small;">0.3</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">END</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span></div>
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: silver; font-family: "Courier New"; font-size: x-small;">/</span></div>
</div>
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; color: #222222; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<span style="color: blue; font-family: "Courier New"; font-size: x-small;">CREATE</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">OR</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">replace</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">FUNCTION</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: #ff0080; font-family: "Courier New"; font-size: x-small;"><b>Func_with_pragma</b></span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">ip_n_sal</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: black; font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">RETURN</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: black; font-family: "Courier New"; font-size: x-small;"><i>PLS_INTEGER</i></span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">IS</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">PRAGMA</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">udf</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">BEGIN</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">RETURN</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">ip_n_sal</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">*</span><span style="color: black; font-family: "Courier New"; font-size: x-small;">0.3</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="color: black; font-family: "Courier New"; font-size: x-small;"> </span><br style="color: black; font-family: "Courier New"; font-size: small;" /><div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "Courier New"; font-size: x-small;">END</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span></div>
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: silver; font-family: "Courier New"; font-size: x-small;">/</span></div>
</div>
<br />
In the below anonymous block, the three functions (Functional WITH clause, Function with and without the PRAGMA UDF clause), calculating the tax incurred in a similar fashion are bulk fetched into a nested table as shown. The timings of these operations are calculated and found that, <br />
The Function with UDF Pragma is better than the Functional WITH clause is better than the Function without UDF pragma. <br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: blue; font-family: "Courier New"; font-size: x-small;">DECLARE</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">TYPE</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">type_rec</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">IS</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">RECORD</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">empno</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">,</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">ename</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>VARCHAR2</i></span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="font-family: "Courier New"; font-size: x-small;">10</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">,</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">sal</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">,</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">tax_incurred</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">TYPE</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">type_ntt</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">IS</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">TABLE</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">OF</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>TYPE_REC</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_ntt_var1</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>TYPE_NTT</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_start_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_start_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_var1</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>NUMBER</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;"><i>SYS_REFCURSOR</i></span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">BEGIN</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_start_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_start_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_cpu_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">OPEN</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">FOR</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="color: red; font-family: "Courier New"; font-size: x-small;">'SELECT empno, ename, sal sal_per_month, func_without_pragma(sal) sal_per_annum FROM emp'</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">FETCH</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">bulk</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">collect</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">INTO</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_ntt_var1</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">CLOSE</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_cpu_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_output</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "Courier New"; font-size: x-small;"><b>Put_line</b></span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="color: red; font-family: "Courier New"; font-size: x-small;">'Function Without Pragma UDF: Run time=> '</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_time-l_n_start_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">/</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;">100</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: red; font-family: "Courier New"; font-size: x-small;">' Seconds, CPU time=> '</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_cpu_time-l_n_start_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">/</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;">100</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: red; font-family: "Courier New"; font-size: x-small;">' Seconds.'</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_start_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_start_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_cpu_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">OPEN</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">FOR</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="color: red; font-family: "Courier New"; font-size: x-small;">'WITH FUNCTION func_with_clause( ip_n_sal NUMBER) RETURN pls_integer IS BEGIN RETURN ip_n_sal*12; END; SELECT empno, ename, sal sal_per_month, func_with_clause(sal) sal_per_annum FROM emp'</span><span style="font-family: "Courier New"; font-size: x-small;"></span><br style="font-family: "Courier New"; font-size: small;" /><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">FETCH</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">bulk</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">collect</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">INTO</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_ntt_var1</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">CLOSE</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_cpu_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_output</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "Courier New"; font-size: x-small;"><b>Put_line</b></span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="color: red; font-family: "Courier New"; font-size: x-small;">'Functional WITH clause: Run time=> '</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_time-l_n_start_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">/</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;">100</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: red; font-family: "Courier New"; font-size: x-small;">' Seconds, CPU time=> '</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_cpu_time-l_n_start_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">/</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;">100</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: red; font-family: "Courier New"; font-size: x-small;">' Seconds.'</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_start_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_start_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_cpu_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">OPEN</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">FOR</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="color: red; font-family: "Courier New"; font-size: x-small;">'SELECT empno, ename, sal sal_per_month, func_with_pragma(sal) sal_per_annum FROM emp'</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">FETCH</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">bulk</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">collect</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">INTO</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_ntt_var1</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">CLOSE</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_rf_var1</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: blue; font-family: "Courier New"; font-size: x-small;">:=</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_utility</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">get_cpu_time</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><br style="font-family: "Courier New"; font-size: small;" /><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">dbms_output</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">.</span><span style="color: #ff0080; font-family: "Courier New"; font-size: x-small;"><b>Put_line</b></span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="color: red; font-family: "Courier New"; font-size: x-small;">'Function With Pragma UDF: Run time=> '</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_time-l_n_start_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">/</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;">100</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: red; font-family: "Courier New"; font-size: x-small;">' Seconds, CPU time=> '</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">(</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">l_n_end_cpu_time-l_n_start_cpu_time</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">/</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><span style="font-family: "Courier New"; font-size: x-small;">100</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="font-family: "Courier New"; font-size: x-small;"> ||</span><span style="color: red; font-family: "Courier New"; font-size: x-small;">' Seconds.'</span><span style="color: maroon; font-family: "Courier New"; font-size: x-small;">)</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span><br style="font-family: "Courier New"; font-size: small;" /><span style="color: blue; font-family: "Courier New"; font-size: x-small;">END</span><span style="color: silver; font-family: "Courier New"; font-size: x-small;">;</span><span style="font-family: "Courier New"; font-size: x-small;"> </span></div>
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="color: silver; font-family: "Courier New"; font-size: x-small;">/</span></div>
</div>
<div class="auto-style1" style="background-color: #eefcff; color: #222222; font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style9" style="background-color: #eefcff; color: #222222; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style9" style="background-color: #eefcff; color: #222222; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style9" style="background-color: #eefcff; color: #222222; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; margin: 0in 0in 0.0001pt 0.2in;">
<span style="font-family: "courier new";"><span style="font-size: 10.6667px;">Function Without Pragma UDF: Run time=> 2.25 Seconds, CPU time=> 2.21 Seconds.</span></span></div>
<div class="auto-style9" style="background-color: #eefcff; color: #222222; margin: 0in 0in 0.0001pt 0.2in;">
<span style="font-family: courier new;"><span style="font-size: 10.6667px;">Functional WITH clause: Run time=> 1.13 Seconds, CPU time=> 1.15 Seconds.</span></span></div>
<div class="auto-style9" style="background-color: #eefcff; color: #222222; margin: 0in 0in 0.0001pt 0.2in;">
<span style="font-family: courier new;"><span style="font-size: 10.6667px;">Function With Pragma UDF: Run time=> .68 Seconds, CPU time=> .67 Seconds.</span></span></div>
<div class="auto-style9" style="background-color: #eefcff; color: #222222; margin: 0in 0in 0.0001pt 0.2in;">
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"><br /></span></span></div>
<div class="auto-style9" style="background-color: #eefcff; color: #222222; margin: 0in 0in 0.0001pt 0.2in;">
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"><br /></span></span></div>
<div class="auto-style9" style="background-color: #eefcff; color: #222222; margin: 0in 0in 0.0001pt 0.2in;">
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"><br /></span></span></div>
<div class="auto-style9" style="background-color: #eefcff; color: #222222; margin: 0in 0in 0.0001pt 0.2in;">
<div style="color: black;">
Thank you,</div>
<div style="color: black;">
Boobal Ganesan</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-85120173715621673292017-08-29T12:59:00.001+05:302017-08-29T12:59:09.121+05:30Choosing COALESCE over NVL<div dir="ltr" style="text-align: left;" trbidi="on">
The NVL and the COALESCE functions are basically the same. They return the first NOT NULL argument and if there are no NOT NULL arguments, they return null. The main difference is that the NVL function accepts only two arguments, but the COALESCE function accepts a minimum of 2 and a maximum of 65535 arguments.<br />
<br />
Another important difference between the NVL and COALESCE functions is that the NVL function evaluates both the arguments, but the COALESCE function stops its evaluation at the first occurrence of the not null argument. Because of this, there is a performance loss in the NVL function if the first argument is not null and the second argument consumes more time in its evaluation. This scenario is handled perfectly by the COALESCE function with two arguments.<br />
<br />
In the below example, both the NVL and the COALESCE functions are passed with the literal “1” as their first argument and a function returning the literal “2” after a 5 second time gap as their second argument. The NVL function returns the first argument (literal “1”) as it is the first NOT NULL argument but takes 5 seconds to finish the task as it also evaluates the second argument. The COALESCE function, on the other hand, returns the first argument (literal “1”) as it is the first NOT NULL argument in no time as it doesn't have to evaluate the second argument.<br />
<br />
<br />
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="border-color: inherit; border-style: none; border-width: medium; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<span style="font-family: courier new;"><span style="font-size: 10.6667px;">DECLARE</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> l_n_start_time NUMBER;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> l_n_end_time NUMBER;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> l_n_var1 NUMBER;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> FUNCTION func_sleep</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> RETURN NUMBER</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> IS</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> BEGIN</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> dbms_lock.sleep(5);</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> RETURN 2;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> END;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;">BEGIN</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> l_n_start_time:=dbms_utility.get_time;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> l_n_var1 :=COALESCE(1,func_sleep);</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> l_n_end_time :=dbms_utility.get_time;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> dbms_output.put_line('Run time taken by the COALESCE function is '||(l_n_end_time-l_n_start_time)/100||' Seconds');</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> l_n_start_time:=dbms_utility.get_time;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> l_n_var1 :=NVL(1,func_sleep);</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> l_n_end_time :=dbms_utility.get_time;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"> dbms_output.put_line('Run time taken by the NVL function is '||(l_n_end_time-l_n_start_time)/100||' Seconds');</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;">END;</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;">/</span></span></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style9" style="margin: 0in 0in 0.0001pt 0.2in;">
<span style="font-family: courier new;"><span style="font-size: 10.6667px;">Run time taken by the COALESCE function is 0 Seconds</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;">Run time taken by the NVL function is 5 Seconds</span></span><br />
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"><br /></span></span>
<span style="font-family: courier new;"><span style="font-size: 10.6667px;"><br /></span></span>
Thank you,<br />
Boobal Ganesan</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com2tag:blogger.com,1999:blog-5666492602651179872.post-25173771718179954592017-08-17T15:02:00.000+05:302017-09-10T03:29:20.743+05:30Evolution of Oracle
<title>Evolution of Oracle</title>
<meta name="keywords" content="Evolution of Oracle">
<meta name="description" content="Evolution of Oracle">
<div dir="ltr" style="text-align: left;" trbidi="on">
This blog explains the evolution of Oracle from its inception as a relational database and then out numbering its competitors for the past 3 decades as the world’s most robust and flexible relational database.<br />
<br />
<b>Oracle version 2 (1979)</b> was the very first commercial release and they named it as version 2 as they believed that any potential customer will be more hesitant to buy the very first version of any software. This version had the complete implementation of SQL but lacked reliability.<br />
<br />
<b>Oracle version 3 (1983)</b> was completely rewritten in C language to support portability beyond the range of operating systems. This version of Oracle solved the reliability issue with the earlier release. Any SQL statement executed here would either be committed or rolled back.<br />
<br />
<b>Oracle version 4 (1984)</b> improved the stability and read consistency. For example, the transaction performed between the accounts is not mis-computed when a query is being executed.<br />
<br />
<b>Oracle version 5.1 (1985) and 5.2 (1986) </b>worked as a distributed database by introducing the first every service/ client relational database so that a client running on a machine in one location could access a server over a network. This version also supported distributed querying as one query could access data stored from more than one location.<br />
<br />
<b>Oracle version 6 (1988)</b> introduced a new architecture on the availability of the database during a transaction. This version primarily changed the locking method from table level to row level, resulting in better system throughput when many users are accessing the database. This version also allowed hot backups, the process of taking a backup of the database while it is still in use.<br />
<br />
<b>Oracle version 7 (1992)</b> solved the procedural limitation of the SQL by allowing the database users to create Programmable Logical Structured Query Language in short PL/SQL codes and thus making it an efficient programming language of all the fourth generation languages. This version allowed us to create Procedures, Functions and Triggers along with distributed transactions and security methods allowing programmers to create complex business rules.<br />
<br />
<b>Oracle version 8 (1997) </b>was designed to work with Oracle’s Network Computer and this version supported OLTP system, HTML and Java interface. Oracle version 8.1 (1998) supported parallel processing with Linux, which eliminated the highly costing downtime.<br />
<br />
<b>Oracle version 9i (2001)</b> introduced the concept of Real Application Clustering and provided high availability in the Oracle database. This version allowed the database to integrate relational and multidimensional processing and introduced the concept of table compression, which reduced the disk size from 3 to 10 times and increased the performance when accessing the data.<br />
<br />
<b>Oracle version 10g (2003)</b> introduced us to the grid technology for sharing the hardware resources against the data centers, thus lowering the infrastructure cost. By introducing Oracle 10g Express Edition, Oracle gave the entry level business corporations to make the most of the Oracle technology with no cost at all.<br />
<br />
<b>Oracle version 11g (2007)</b> introduced some salient features like flashback data archive, virtual column, parallel back up of the same files, case sensitive passwords and wide range of performance and optimization enhancements making it a more stable release of all the time.<br />
<br />
<b>Oracle version 12c (2013)</b> is out of Oracle’s major innovation which supported multi-tenancy – an option which allows us to share common infrastructure like memory and background processes between multiple databases. These are called as “pluggable” databases which are plugged into a “container” or “master” database. The main advantage of this technology is to possibly allow n- number of databases to run on a single hardware with complete security and isolation between them.<br />
<br />
<br />
Thank you,<br />
Boobal Ganesan</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-70048589555836129492017-08-16T01:18:00.001+05:302017-08-16T01:18:31.509+05:30PL/SQL Multiset operator tips<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The <i>multiset</i> operators are a bunch in number, which combines two or more collection types of the same type and returns a collection result of the same type that is appropriate to the operator used. These perform a similar operation to that of the SQL set operators, where the former works only on the collection types and the latter on the SQL SELECT statements.<o:p></o:p></div>
<div style="border-bottom: 1pt dotted windowtext; border-image: initial; border-left: none; border-right: none; border-top: none; margin-left: 0.2in; margin-right: 0in; padding: 0in 0in 1pt;">
<div class="auto-style3" style="border-color: inherit; border-style: none; border-width: medium; font-family: "Arial Narrow", sans-serif; font-size: 11pt; font-weight: bold; margin: 6pt 0in 6pt 0.2in; padding: 0in; text-align: justify;">
Multiset operators with their SQL equivalents<o:p></o:p></div>
</div>
<table border="1" cellpadding="0" cellspacing="0" class="auto-style4" style="border-collapse: collapse; border: 1pt solid windowtext; font-family: Calibri, sans-serif; font-size: 10pt; margin-left: 0.2in;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 120.1pt;" valign="top" width="160"><div align="center" class="auto-style5" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Collection SET Operator<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; padding: 0in 5.4pt; width: 143.15pt;" valign="top" width="191"><div align="center" class="auto-style5" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Equivalent SQL SET Operator<o:p></o:p></span></b></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 120.1pt;" valign="top" width="160"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Multiset Union<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 143.15pt;" valign="top" width="191"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Union all<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 120.1pt;" valign="top" width="160"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Multiset Union</span><span lang="EN-IN"> all<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 143.15pt;" valign="top" width="191"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Union all<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 120.1pt;" valign="top" width="160"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Multiset Union Distinct<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 143.15pt;" valign="top" width="191"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Union<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 120.1pt;" valign="top" width="160"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Multiset Intersect<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 143.15pt;" valign="top" width="191"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">NA<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 120.1pt;" valign="top" width="160"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Multiset Intersect Distinct<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 143.15pt;" valign="top" width="191"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Intersect<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 120.1pt;" valign="top" width="160"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Multiset Except<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 143.15pt;" valign="top" width="191"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">NA<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 120.1pt;" valign="top" width="160"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Multiset Except Distinct<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 143.15pt;" valign="top" width="191"><div class="auto-style6" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Minus<o:p></o:p></span></div>
</td></tr>
</tbody></table>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below nested table type is created as a persistent object for explaining the different multiset operators.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
CREATE OR REPLACE type type_ntt<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
TABLE OF VARCHAR2(1);<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style8" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12.5pt;">Multiset Union [All]<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The <i>multiset union</i> operator evaluates two collection instances and returns a single instance, which contains all the elements from the input two instances. If there are any duplicate elements found, they are returned as such. This operator is identical to the <i>multiset union all</i>operator. This operator is equivalent to the <i>union all</i> operator in SQL.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
In the below example, two instances of a single nested type are created. The first instance is assigned to A, B, C and D characters and the second instance is assigned to A and B characters. When they are operated, they just append the elements of the second nested table type instance of the first one.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WITH<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FUNCTION func_set RETURN type_ntt<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1 type_ntt :=type_ntt('A', 'B', 'C', 'D');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var2 type_ntt :=type_ntt('A', 'B');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
BEGIN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
RETURN l_ntt_var1 multiset UNION l_ntt_var2;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT * FROM TABLE(func_set);<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
A<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
B<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
C<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
D<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
A<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
B<o:p></o:p></div>
<div class="auto-style8" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12.5pt;">Multiset Union Distinct<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
This operator works similar to the <i>multiset union</i> operator along with the duplication elements removal. This operator is equivalent to the <i>union </i>operator in SQL. The <i>distinct</i> keyword used in this operator cannot be replaced with its synonymous keyword <i>unique</i>.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div>
<table cellpadding="0" cellspacing="0" hspace="0" style="width: 444px;" vspace="0"><tbody>
<tr><td align="left" style="padding: 9.35pt;" valign="top"><div style="background: rgb(230, 230, 230); border: 3.75pt double windowtext; margin-left: 0.45in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style10" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.7in; padding: 0in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Wingdings; font-size: 18pt;">%<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span>Note: The result returned by this operator is notsorted, unlike the SQL union operator.<o:p></o:p></div>
</div>
</td></tr>
</tbody></table>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
In the below example, the functional with clause has two instances with a list of values assigned to them. The TABLE function in the select statement returns the total list of elements from the two instances removing the duplication without sorting them.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WITH<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FUNCTION func_set RETURN type_ntt<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1 type_ntt :=type_ntt('E', 'B', 'C', 'D');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var2 type_ntt :=type_ntt('A', 'B');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
BEGIN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
RETURN l_ntt_var1 multiset UNION Distinct l_ntt_var2;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT * FROM TABLE(func_set);<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
E<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
B<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
C<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
D<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
A<o:p></o:p></div>
<div class="auto-style8" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12.5pt;">Multiset Intersect<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The <i>multiset intersect</i> operator evaluates two collection instances of the same type and returns the common elements in them without any duplication removal. This operator does not have an equivalent SQL set operator.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
In the below listing, the two instances of the nested table type are created and assigned to a list of values to them. The TABLE function returns the common duplicated unsorted elements from two instances.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WITH<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FUNCTION func_set RETURN type_ntt<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1 type_ntt :=type_ntt('A', 'A', 'C', 'D');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var2 type_ntt :=type_ntt('A', 'A', 'B');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
BEGIN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
RETURN l_ntt_var1 multiset intersect l_ntt_var2;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT * FROM TABLE(func_set);<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
A<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
A<o:p></o:p></div>
<div class="auto-style8" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12.5pt;">Multiset Intersect Distinct<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
This operator works similar to the <i>multiset intersect</i> operator explained in the above section with additional duplicate element removal. In the below example, the operator works on the two instances loaded with a list of values with each other and return common unique unsorted element values using the TABLE function. Usually, the equivalent SQL set operator sorts their results, unlike this collection operator. The <i>distinct</i> keyword used in this operator cannot be replaced with its synonymous keyword <i>unique</i>.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WITH<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FUNCTION func_set RETURN type_ntt<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1 type_ntt :=type_ntt('B', 'B', 'A', 'A');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var2 type_ntt :=type_ntt('A', 'A', 'C', 'C', 'B', 'B');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
BEGIN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
RETURN l_ntt_var1 multiset intersect distinct l_ntt_var2;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT * FROM TABLE(func_set);<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
B<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
A<o:p></o:p></div>
<div class="auto-style8" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12.5pt;">Multiset Except<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The <i>multiset except</i> operator evaluates two similar collection instances and returns the remaining elements from the first instance after removing any matching elements from the second instance as its resultant. This operator does not have an SQL equivalent.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
In the below example, the two instances with a list of elements are operated on the <i>multiset except </i>operator and returns the uncommon elements from the first instance without performing any duplication removal or sorting.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WITH<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FUNCTION func_set RETURN type_ntt<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1 type_ntt :=type_ntt('C', 'C', 'B', 'A', 'D');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var2 type_ntt :=type_ntt('D', 'A');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
BEGIN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
RETURN l_ntt_var1 multiset except l_ntt_var2;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT * FROM TABLE(func_set);<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
C<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
C<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
B<o:p></o:p></div>
<div class="auto-style8" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12.5pt;">Multiset Except Distinct<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
This operator works similar to the <i>multiset except </i>operator but performs an additional duplication removal operation to the result. This operator still does not sort its resultant, unlike its SQL equivalent. The <i>distinct</i> keyword used in this operator cannot be replaced with its synonymous keyword <i>unique</i>.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
In the below example, the two instances with a list of elements are operated on this operator to return the uncommon elements list from the first instance with duplication check and no sorting.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WITH<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FUNCTION func_set RETURN type_ntt<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1 type_ntt :=type_ntt('C','C', 'B', 'A', 'D');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var2 type_ntt :=type_ntt('D', 'A');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
BEGIN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
RETURN l_ntt_var1 multiset except distinct l_ntt_var2;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT * FROM TABLE(func_set);<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
C<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
B</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-320568134179174972017-08-16T01:17:00.001+05:302017-08-16T01:17:13.452+05:30PL/SQL collection types tips<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The collections are homogeneous powerful single dimensional structures which are capable of managing large sets of ordered values belonging to the same type, where each element can be identified individually by their index value. The data processed by the collection are session specific and are stored in the user global area (UGA), which is stored in the SGA when using a shared server connection and in PGA when using a dedicated connection. There are three different collection types as Nested table, VARRAY and Associative array, which can be categorized based on multiple terminologies as described below.<o:p></o:p></div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
Persistent and Transient<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The collections are segregated into two types, Persistent, and Transient, based on their lifetime in the database. The persistent collection types can store their instances permanently in the database. Nested tables and VARRAYs fall under this category as these are capable of acting as the data types of columns in a database table. The non-persistent or transient collection types are not stored in the database permanently and have their lifetime limited to the duration of the PL/SQL unit. Associative arrays, Nested tables, and VARRAYs fall under this category when they are declared dynamically in the declaration section of a PL/SQL unit, subprogram or a package.<o:p></o:p></div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
Bounded and Unbounded<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The collections are categorized into two types, Bounded, and Unbounded, based on the limit of the number of elements they can accommodate. The bounded collection types have a predefined limit on the number of elements to be accommodated. VARRAY is a bounded type, where its upper bound value has to be determined during their declaration. Nested table and Associative array fall under the unbounded category, where they do not have a limit on the number of elements they can accommodate them.<o:p></o:p></div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
Numeric Index and String Index<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The collection types are divided into two types, Numeric index type and String index type, based on the data type of the index value they use for their element storage. The numeric index based collection types allow us to define only integers as the index values of the elements. Nested table and VARRAY types follow numeric indexing, where they prohibit us in using any other type of index value for their list. The index value starts from 1 by default for these collection types. The string index type based collection types allow us to define characters as their element’s index value. An associative array is a string index based collection type and it provides us with a flexibility of having either integer or string as its index type. This type also allows us to use negative integers for subscripts.<o:p></o:p></div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
Sparse and Dense<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The collections are split into two types, Sparse, and Dense, based on the element availability. The spare collections allow undefined or sequentialless elements, i.e., there can be gaps between the first and the last element in the collection. Nested table and Associative array are examples of the sparse collection, where they do not mind their elements getting deleted or removed from the sequence unless they are defined with an NOT NULL constraint. The dense collections must define all their elements with a value, at least Null unless it is defined with an NOT NULL constraint. They do not allow any gaps in their list and raise an error when we try to delete an element from their list. VARRAY is a dense collection type, and they do not allow us to make a gap in their element list.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The PL/SQL collection types do not support multidimensional structure with SQL data types. We can, however, build multidimensional collection structures using records, objects or other collection types as their element’s data type.<o:p></o:p></div>
<div class="auto-style4" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 16pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
Choosing a Collection Type<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Choosing the right collection type for our application might be challenging as there could be multiple acceptable choices in a situation. The below section guarantees in providing a high insight of the advantages of one collection type over the other, which will help us in making up our mind to some extent.<o:p></o:p></div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
When to choose an Associative array?<o:p></o:p></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>When we want to cache a small key-pair valued table in the memory for temporary lookup purpose.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>When we need flexibility in our subscripts. This type allows string, negative integers, and non-sequential integers to be used as subscripts for the collection elements.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
3.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>When we want to pass the collection to and from the database server using Oracle Call Interface (OCI) or the Oracle precompiler.<o:p></o:p></div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
When to choose a Nested table?<o:p></o:p></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>When we want to store a large amount of persistent data in a table’s column.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>When we must not worry about the subscript going out of sequence due to updates and deletes performed over the collection elements.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
3.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>When we do not know the maximum number of elements to be stored in a collection during its declaration.<o:p></o:p></div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
When to choose a VARRAY?<o:p></o:p></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>When we want to store a small amount of persistent data in a table’s column.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>When we are more concerned about the number of elements stored in the collection.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
3.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>When we want to preserve the order in which the elements are inserted into the collection.</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-83935079504966012002017-08-14T17:27:00.000+05:302017-08-14T17:27:16.255+05:30PL/SQL Collection Exceptions Tips<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The bulk binding feature was introduced in Oracle version 8i as the FORALL statement, which is used for the batch processing of large DML statements without the need of switching between the SQL and the PL/SQL engine for every single row. Even though the performance was increased using this feature, there is also a downside to it. When a single row from the DML operation fails, the FORALL statement fails entirely. To address this issue, Oracle has introduced the SAVE EXCEPTIONS clause. This clause instructs the system to skip the error prone rows and to process the rest perfectly fine rows rather failing the entire statement.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
When the SAVE EXCEPTIONS clause is added to the FORALL statement, all the errors spotted during the batch processing are saved in the cursor SQL%BULK_EXCEPTIONS, which stores a collection of records with two attributes as shown below.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>ERROR_INDEX</b>: The index value of the collection element which failed during the DML operation is stored in this attribute.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>ERROR_CODE</b>: The appropriate error code for the exception raised corresponding to the error index is stored in this attribute.<o:p></o:p></div>
<div class="auto-style4" style="font-family: Garamond, serif; font-size: 14pt; margin: 0in 0in 0.0001pt 35.4pt;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The exceptions raised during a FORALL DML operation can be captured by using the Oracle error code ORA-24381, when the SAVE EXCEPTIONS clause is used. During this time, the rest of the program code will not be continued and the control directly gets into the exception section once after the FORALL clause completes its operation successfully.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
To portray the exceptions in bulk binding, an object type TYPE_OBJ is created with 6 attributes pertaining to an employee’s information is created as shown below,<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
CREATE OR REPLACE type type_obj<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
object<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
(<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
emp_id VARCHAR2(50),<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
emp_first_name VARCHAR2(50),<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
emp_last_name VARCHAR2(50),<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
emp_email VARCHAR2(50),<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
emp_hire_date VARCHAR2(50),<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
emp_job_id VARCHAR2(50));<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below code depicts the complete functionality of the SAVE EXCEPTIONS clause in a FORALL statement. The code begins by assigning a name to the error code ORA-24381, which is the Oracle assigned error code for the bulk binding exceptions. The nested table typeTYPE_NTT is created over the object type to store more than one employee information in a collective way. An instance of the nested table type is then created and assigned with 7 employees information. Here, the employee details for the index value [3] has a Null job ID, [5] has an invalid hire date and [6] has a Null last name, which all results into exceptions when they are inserted into the EMPLOYEES table having these validations.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
When the employee information stored in the nested table is bulk inserted into the EMPLOYEES table with the SAVE EXCEPTIONS clause, the DML operation successfully completes where the error-prone data are formally collected into the system defined collection type BULK_EXCEPTIONS as shown in the below example.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The failed records can then be collected for analysis from the exception block by iterating the error prone records using the BULK_EXCEPTIONS.COUNT attribute. The index value and the error code of the failed records can be retrieved through the BULK_EXCEPTIONS.ERROR_INDEX and BULK_EXCEPTIONS.ERROR_CODE attributes as mentioned earlier. The corresponding error message for the error code can be retrieved by negating the error code and passing it to the SQLERRM function as its only formal parameter.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
DECLARE<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
bulk_error EXCEPTION;<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
pragma exception_init(bulk_error, -24381);<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
type type_ntt<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
TABLE OF type_obj;<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1 type_ntt:=type_ntt();<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
BEGIN<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1.extend(7);<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(1):= type_obj('207', 'Marie', 'John', 'MJOHN1', '10-April-2005', 'AD_PRES');<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(2):= type_obj('208', 'Abdul', 'Kalam', 'AKALAM2',<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'05-September-1995', 'IT_PROG');<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(3):= type_obj('209A', 'Rahul', 'Dravid', 'RDRAVID6',<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'02-August-2001', '');<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(4):= type_obj('210', 'Mike', 'Thompson', 'MTHOMS3',<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'29-December-1999', 'AD_VP');<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(5):= type_obj('211', 'Paul', 'Livingston', 'PLVNGS8',<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'22B-June-2008', 'FI_MGR');<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(6):= type_obj('212', 'King', '', 'KRAM8', '10-October-2005',<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'PU_CLERK');<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(7):= type_obj('213', 'Daniel', 'Morrison', 'DMORR4',<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'07-February-2011', 'SA_REP');<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FORALL loop_ntt IN indices OF l_ntt_var1 SAVE exceptions<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
INSERT<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
INTO<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
employees<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
(<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
employee_id,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
first_name,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
last_name,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
email,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
hire_date,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
job_id<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
)<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
VALUES<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
(<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(loop_ntt).emp_id,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(loop_ntt).emp_first_name,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(loop_ntt).emp_last_name,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(loop_ntt).emp_email,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(loop_ntt).emp_hire_date,<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
l_ntt_var1(loop_ntt).emp_job_id<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
);<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
dbms_output.put_line('This message is printed only if there is no exception raised in the FORALL statement!');<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
EXCEPTION<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WHEN bulk_error THEN<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
dbms_output.put_line('Total number of inserted rows: '||sql%rowcount);<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
dbms_output.put_line('Total number of rejected rows: '||<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
sql%bulk_exceptions.count);<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FOR loop_error IN 1..sql%bulk_exceptions.count<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
LOOP<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
dbms_output.put_line<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
('Error Index: '||sql%bulk_exceptions(loop_error).error_index||<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'. Error Code: '||sql%bulk_exceptions(loop_error).error_code||<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'. Error Message: '||sqlerrm(-sql%bulk_exceptions(loop_error).error_code));<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END LOOP loop_error;<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END;<o:p></o:p></div>
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style6" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style6" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style6" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
Total number of inserted rows: 4<o:p></o:p></div>
<div class="auto-style6" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
Total number of rejected rows: 3<o:p></o:p></div>
<div class="auto-style6" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
Error Index: 3. Error Code: 1722. Error Message: ORA-01722: invalid number<o:p></o:p></div>
<div class="auto-style6" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
Error Index: 5. Error Code: 1861. Error Message: ORA-01861: literal does not match format string<o:p></o:p></div>
<div class="auto-style6" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
Error Index: 6. Error Code: 1400. Error Message: ORA-01400: cannot insert NULL into ()<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The error report shows us the number of successfully inserted records, the number of failed records and then lists all the failed records with supporting reasons for their failure.</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Thank you,</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Boobal Ganesan</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-27813615236784407632017-08-14T17:25:00.002+05:302017-08-14T17:25:37.357+05:30DBMS_SQL.DESCRIBE_COLUMNS tips<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The DESCRIBE_COLUMNS API describes the columns of the SELECT statement which is opened and parsed through a cursor. This procedure consists of one input parameter accepting the cursor ID which is active in the session and two output parameters producing the number of columns in the statement parsed by the cursor and their description respectively.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The syntax for this procedure is shown below,<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
PROCEDURE describe_columns(c IN INTEGER, col_cnt OUT INTEGER, desc_t OUT desc_tab);<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The third parameter has a nested table DESC_TAB as its data type which is created from the index by table DESC_REC which has its structure as below,<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
Type desc_rec<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
IS<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
record<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
(<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_type binary_integer := 0,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_max_len binary_integer := 0,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_name VARCHAR2(32) := '',<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_name_len binary_integer := 0,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_schema_name VARCHAR2(32) := '',<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_schema_name_len binary_integer := 0,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_precision binary_integer := 0,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_scale binary_integer := 0,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_charsetid binary_integer := 0,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_charsetform binary_integer := 0,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
col_null_ok BOOLEAN := TRUE);<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The above index by table structure has 11 columns which holds all possible information about the columns parsed through the cursor.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
In the below listing, the EMPLOYEES table is parsed and then described using the DESCRIBE_COLUMNS procedure. All the necessary information corresponding to a column is retrieved from the nested table output parameter in the DECRIBE_COLUMNS procedure and is inserted into a test table which holds the column ID in its first column and the column description in its second column. The insertion is looped and the loop lives the range between 1 and the column count value returned by the DESCRIBE_COLUMNS procedure.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.25in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>SET SERVEROUTPUT ON 200000;<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>DECLARE<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
3.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>l_ntt_desc_tab dbms_sql.desc_tab;<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
4.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>l_i_cursor_id INTEGER;<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
5.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>l_i_col_cnt INTEGER;<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
6.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>l_vc_query VARCHAR2(100):='select e.rowid,e.* from Employees e';<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
7.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>BEGIN<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
8.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>l_i_cursor_id:=dbms_sql.open_cursor;<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
9.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_sql.parse(l_i_cursor_id, l_vc_query, dbms_sql.native);<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
10.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_sql.describe_columns(l_i_cursor_id, l_i_col_cnt, l_ntt_desc_tab);<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
11.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>FOR loop_dc IN 1..l_i_col_cnt<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
12.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>LOOP<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
13.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_name:'||decode(l_ntt_desc_tab(loop_dc).col_name, Null, 'Null', l_ntt_desc_tab(loop_dc).col_name));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
14.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_type:'||decode(l_ntt_desc_tab(loop_dc).col_type, Null, 'Null', l_ntt_desc_tab(loop_dc).col_type));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
15.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_precision:'||decode(l_ntt_desc_tab(loop_dc).col_precision, Null, 'Null', l_ntt_desc_tab(loop_dc).col_precision));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
16.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_max_len:'||decode(l_ntt_desc_tab(loop_dc).col_max_len, Null, 'Null', l_ntt_desc_tab(loop_dc).col_max_len));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
17.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_name_len:'||decode(l_ntt_desc_tab(loop_dc).col_name_len, Null, 'Null', l_ntt_desc_tab(loop_dc).col_name_len));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
18.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_schema_name:'||decode(l_ntt_desc_tab(loop_dc).col_schema_name, Null, 'Null', l_ntt_desc_tab(loop_dc).col_schema_name));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
19.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_schema_name_len:'||decode(l_ntt_desc_tab(loop_dc).col_schema_name_len, Null, 'Null', l_ntt_desc_tab(loop_dc).col_schema_name_len));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
20.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_scale:'||decode(l_ntt_desc_tab(loop_dc).col_scale, Null, 'Null', l_ntt_desc_tab(loop_dc).col_scale));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
21.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_charsetid:'||decode(l_ntt_desc_tab(loop_dc).col_charsetid, Null, 'Null', l_ntt_desc_tab(loop_dc).col_charsetid));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
22.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'col_charsetform:'||decode(l_ntt_desc_tab(loop_dc).col_charsetform, Null, 'Null', l_ntt_desc_tab(loop_dc).col_charsetform));<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
23.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>IF l_ntt_desc_tab(loop_dc).col_null_ok THEN<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
24.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'Nullable:Y'); <o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
25.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>ELSE<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
26.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>INSERT INTO desc_col_test (col_id, col_desc) VALUES (loop_dc, 'Nullable:N');<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
27.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>END IF;<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
28.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>COMMIT;<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
29.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>END LOOP loop_dc;<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
30.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>END;<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
31.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>/<o:p></o:p></div>
</div>
<div style="border-bottom: 1pt dotted windowtext; border-image: initial; border-left: none; border-right: none; border-top: none; margin-left: 0.2in; margin-right: 0in; padding: 0in 0in 1pt;">
<div class="auto-style5" style="border-color: inherit; border-style: none; border-width: medium; font-family: "Arial Narrow", sans-serif; font-size: 11pt; font-weight: bold; margin: 6pt 0in 6pt 0.2in; padding: 0in; text-align: justify;">
Script Explanation<o:p></o:p></div>
</div>
<table border="1" cellpadding="0" cellspacing="0" class="auto-style6" style="border-collapse: collapse; border: 1pt solid windowtext; font-family: Calibri, sans-serif; font-size: 10pt; margin-left: 0.2in;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Line No.<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Description<o:p></o:p></span></b></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">This environment variable opens up an output buffer of size limit of 200000.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Start of the declare section of the block.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">3<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">A local variable l_ntt_desc_tab is declared with dbms_sql.desc_tab nested table data type.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">4<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">A local variable l_i_cursor_id is declared with INTEGER data type.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">5<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">A local variable l_i_col_cnt is declared with INTEGER data type.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">6<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">A local variable l_vc_query is declared with VARCHAR2 data type with a precision of 100 characters is defaulted to a dynamic SELECT query which selects the pseudo column and all other columns from the EMPLOYEES table.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">7<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Start of the execution section of the block.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">8<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">The function DBMS_SQL.OPEN_CURSOR is executed and its return value is assigned to the local variable l_i_cursor_id.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">9<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">The procedure DBMS_SQL.PARSE is executed with its first parameter as the local variable l_i_cursor_id, the second parameter as the local variable l_vc_query and the third parameter as the function DBMS_SQL.NATIVE.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">10<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">The procedure DBMS_SQL.DESCRIBE_COLUMNS is executed with its input parameter as the local variable l_i_cursor_id and its first output parameter as the local variable l_i_col_cnt and the second output parameter as the local variable l_ntt_desc_tab.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">11,12<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Start of the FOR loop with its range between 1 and l_i_col_cnt.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">13-27<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">An insert into the intermediate table DESC_COL_TEST with its first column value as the loop index value and its second column value as the different associative array parameters in the DESC_TAB nested table for each loop index value.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">28<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">The INSERTs performed in the above step is committed.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">29<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">End of the FOR loop.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 51.45pt;" valign="top" width="69"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">30,31<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 326.55pt;" valign="top" width="435"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">End of the execution section of the loop.<o:p></o:p></span></div>
</td></tr>
</tbody></table>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
After the necessary column information is inserted into the intermediate table, the data can be converted into a much more readable format by using the below SQL statement,<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT *<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
(SELECT col_id,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
regexp_substr(col_desc,'[^:]+',1,1) col_desc_name,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
regexp_substr(col_desc,'[^:]+',1,2) col_desc_value<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM desc_col_test<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
) pivot (MAX(col_desc_value) FOR col_desc_name IN ('col_name' AS COL_NAME, 'col_type' AS COL_TYPE, 'col_precision' AS COL_PRECISION,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'col_max_len' AS COL_MAX_LEN, 'col_name_len' AS COL_NAME_LEN,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'col_schema_name' AS COL_SCHEMA_NAME, 'col_schema_name_len' AS COL_SCHEMA_NAME_LEN,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'col_scale' AS COL_SCALE, 'col_charsetid' AS COL_CHARSETID,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
'col_charsetform' AS COL_CHARSETFORM, 'Nullable' AS NULLABLE))<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
ORDER BY col_id;<o:p></o:p></div>
</div>
<div style="border-bottom: 1pt dotted windowtext; border-image: initial; border-left: none; border-right: none; border-top: none; margin-left: 0.2in; margin-right: 0in; padding: 0in 0in 1pt;">
<div class="auto-style5" style="border-color: inherit; border-style: none; border-width: medium; font-family: "Arial Narrow", sans-serif; font-size: 11pt; font-weight: bold; margin: 6pt 0in 6pt 0.2in; padding: 0in; text-align: justify;">
Script Result:<o:p></o:p></div>
</div>
<table border="1" cellpadding="0" cellspacing="0" class="auto-style6" style="border-collapse: collapse; border: 1pt solid windowtext; font-family: Calibri, sans-serif; font-size: 10pt; margin-left: 0.2in;"><tbody>
<tr style="height: 79.6pt;"><td style="border: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_ID<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_NAME<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_TYPE<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_PRECISION<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_MAX_LEN<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_NAME_LEN<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_SCHEMA_NAME<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_SCHEMA_NAME_LEN<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_SCALE<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_CHARSETID<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">COL_CHARSETFORM<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; height: 79.6pt; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">NULLABLE<o:p></o:p></span></b></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">ROWID<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">11<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">16<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">5<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">N<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">EMPLOYEE_ID<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">6<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">22<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">11<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Y<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">3<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">FIRST_NAME<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">20<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">10<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">178<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Y<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">4<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">LAST_NAME<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">25<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">9<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">178<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">N<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">5<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">EMAIL<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">25<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">5<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">178<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">N<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">6<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">PHONE_NUMBER<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">20<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">12<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">178<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Y<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">7<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">HIRE_DATE<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">12<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">7<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">9<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">N<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">8<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">JOB_ID<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">10<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">6<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">178<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">N<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">9<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">SALARY<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">8<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">22<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">6<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Y<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">10<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">COMMISSION_PCT<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">22<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">14<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Y<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">11<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">MANAGER_ID<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">6<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">22<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">10<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Y<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">12<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 45pt;" valign="top" width="60"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">DEPARTMENT_ID<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 27pt;" valign="top" width="36"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">4<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">22<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">13<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Null<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">0<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 31.5pt;" valign="top" width="42"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Y<o:p></o:p></span></div>
</td></tr>
</tbody></table>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The above table data show the detailed information on the columns which are parsed through the cursor in a much readable format.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
When a dynamic statement with its column more than 32 in length is used in the above block like the below query,<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT to_timestamp_tz('30-Sep-1989 04:32:00 PM +05:30','DD-MON-RR HH:MI:SS AM TZH:TZM') at TIME ZONE 'UTC' FROM dual;<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The block throws a run time error as shown below,<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Error report:<o:p></o:p></b></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
ORA-06502: PL/SQL: numeric or value error: dbms_sql.describe_columns overflow, col_name_len=90. Use describe_columns2<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
ORA-06512: at "SYS.DBMS_SQL", line 2070<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
ORA-06512: at line 9<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
06502. 00000 - "PL/SQL: numeric or value error%s"<o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
*Cause: <o:p></o:p></div>
<div class="auto-style9" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
*Action:<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The error states that the column name has exceeded its allowed length and it suggests us to use the DESCRIBE_COLUMNS2 API instead.</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Thank you,</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Boobal Ganesan</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-83045558565014489092017-08-14T17:23:00.002+05:302017-08-14T17:23:33.824+05:30REGEXP_REPLACE Tips<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
This function is a successful extension of both the REPLACE and the TRANSLATE function. This function was introduced in the Oracle version 10g, which replaces a specific portion of the source string using a user customized regular expression based search pattern.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The prototype for the REGEXP_REPLACE function is shown below,<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
REGEXP_REPLACE(<Source_string>, <Search_pattern>[, <Replacement_string>[, <Start_position>[, <Match_occurrence>[, <Match_modifiers>]]]])<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style4" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Source_string</b>: The string to be searched for.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style4" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Search_pattern</b>: The regular expression pattern that is to be searched for in the source string. This can be a combination of the POSIX and the Perl-influenced metacharacters mentioned in the above section.<o:p></o:p></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 14pt; margin: 0in 0in 0.0001pt 35.4pt;">
<br /></div>
<div class="auto-style4" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Replacement_string</b>: This is an optional parameter. The matched patterns will be replaced with the Replacement_string in the source string. If not mentioned, the replacement string will be Null.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style4" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Start_position</b>: This is an optional parameter. This determines the position in the source string where the search starts. By default, it is 1, which is the starting position of the source string.<o:p></o:p></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 14pt; margin: 0in 0in 0.0001pt 35.4pt;">
<br /></div>
<div class="auto-style4" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Match_occurrence</b>: This is an optional parameter. This determines the occurrence of the search pattern. By default, it is 1, which is the first appearance of the search pattern in the string.<o:p></o:p></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 14pt; margin: 0in 0in 0.0001pt 35.4pt;">
<br /></div>
<div class="auto-style4" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Match_modifiers</b>: This is an optional parameter. This parameter allows us to modify, the matching behavior of the function. The valid range of options is mentioned in the <i>Pattern Matching Modifiers</i> section explained above.<o:p></o:p></div>
<div class="auto-style6" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">String Removal<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below statement has a mix of numbers, alphabets and punctuations in its source string. The first match pattern selects all the alphabets, the second match pattern selects all the digits and the third match pattern selects all the punctuations, removes them from the source string respectively, and prints the result.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WITH<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
t AS<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
( SELECT'a0b1c2d3e4f5g6h7i8j9k!l@m#n$o%p^q&r*s(t)u_v+w-x=y[z]' col FROM dual)<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
regexp_replace(col,'[[:alpha:]]') without_alphabets,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
regexp_replace(col,'[[:digit:]]') without_digits,<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
regexp_replace(col,'[[:punct:]]') without_punctuations<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
t;<o:p></o:p></div>
</div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>WITHOUT_ALPHABETS<o:p></o:p></b></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
0123456789!@#$%^&*()_+-=[]<o:p></o:p></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>WITHOUT_DIGITS<o:p></o:p></b></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
abcdefghijk!l@m#n$o%p^q&r*s(t)u_v+w-x=y[z]<o:p></o:p></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>WITHOUT_PUNCTUATIONS<o:p></o:p></b></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
a0b1c2d3e4f5g6h7i8j9klmnopqrstuvwxyz<o:p></o:p></div>
<div class="auto-style6" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Symbol Removal<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below snippet removes all the special symbols from the source string and prints only the readable characters. This query is of much help while saving the emails and documents into the database by removing the unreadable special symbols as a data cleaning process.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
select regexp_replace('Th∞is St☻ring con♥tains ♫special sy▀mbols','[^a-zA-Z ]') regexp_replace from dual;<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
This String contains special symbols<o:p></o:p></div>
<div class="auto-style6" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Space Removal<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below statement removes the spaces which are present more than once in the source string. This script plays a vital role in removing the unwanted spaces from a document or an email before storing them permanently in the database.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
select regexp_replace('This string contains more than one spacing between the words','( ){2,}',' ') regexp_replace from dual;<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
This string contains more than one spacing between the words<o:p></o:p></div>
<div class="auto-style6" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Name Rearrange<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below listing re-arranges the last name and the first name from the source string in a user required format for reporting purposes.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
select regexp_replace('Randy Orton','(.*) (.*)','\2, \1') regexp_replace from dual;<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
Orton, Randy<o:p></o:p></div>
<div class="auto-style6" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Space Addition<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below SQL adds an extra space in between each character from the source string as shown below,<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
select regexp_replace('abcdefghijklmnopqrstuvwxyz','(.)','\1 ') regexp_replace from dual;<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
a b c d e f g h i j k l m n o p q r s t u v w x y z<o:p></o:p></div>
<div class="auto-style6" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Security Measure<o:p></o:p></span></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below statement hides the middle portion of a number as a security measure. This process is done by the banking industry during the account-related communication by hiding the middle portion of the credit card, account number, phone number and by the email servers for OTP generation for user confirmation and security check.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
select regexp_replace('91105434563452345623', '(^[[:digit:]]{4})(.*)([[:digit:]]{4}$)', '\1**********\3') regexp_replace from dual;<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style7" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
9110**********5623</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-861073632184820792017-08-14T17:22:00.001+05:302017-08-14T17:22:31.006+05:30REGEXP_COUNT Tips<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
This function was introduced in Oracle 11g and it allows us to count the number of times a pattern or a substring occurs in the source string. This is very different from the plain COUNT function which is a column level function, whereas, REGEXP_COUNT is a cell level function which operates on each cell individually.<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The prototype of the REGEXP_COUNT function is shown below,<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
REGEXP_COUNT(<Source_string>, <Search_pattern>[, <Start_position>[, <Match_modifiers>]])<o:p></o:p></div>
</div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Source_string</b>: The string to be searched for.<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Search_pattern</b>: The regular expression pattern that is to be searched for in the source string. This can be a combination of the POSIX and the Perl-influenced metacharacters mentioned in the above section.<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Start_position</b>: This is an optional parameter. This determines the position in the source string where the search starts. By default, it is 1, which is the starting position of the source string.<o:p></o:p></div>
<div class="auto-style6" style="font-family: Garamond, serif; font-size: 14pt; margin: 0in 0in 0.0001pt 35.4pt;">
<br /></div>
<div class="auto-style5" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><b>Match_modifiers</b>: This is an optional parameter. This parameter allows us to modify, the matching behavior of the function. The valid range of options is mentioned in the <i>Pattern Matching Modifiers</i> section explained above.<o:p></o:p></div>
<div class="auto-style7" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Text Count<o:p></o:p></span></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The basic operation, which can be done using this function is to count for a character or a series of characters in the source string as shown below.<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT REGEXP_COUNT ('REGEXP_COUNT is a cell level function which operates on each cell individually', 'cell', 1) regexp_count<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM dual;<o:p></o:p></div>
</div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
2<o:p></o:p></div>
<div class="auto-style7" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Digit Count<o:p></o:p></span></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below statement, searches for the number of numeric digits present in the source string using the Perl influenced metacharacter <i>\d.</i><o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT REGEXP_COUNT ('REGEXP_COUNT is introduced in the Oracle version 11gR1', '\d', 1) regexp_count<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM dual;<o:p></o:p></div>
</div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
3<o:p></o:p></div>
<div class="auto-style7" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Vowels Count<o:p></o:p></span></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below shown listing counts for the total number of vowels in the source string with case sensitivity check turned ON by default (Based on the NLS_SORT parameter).<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT REGEXP_COUNT ('REGEXP_COUNT is a cell level function which operates on each cell individually', '[aeiou]', 1) regexp_count<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM dual;<o:p></o:p></div>
</div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
22<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The same snippet is used again for the vowel count, but this time with the case sensitivity turned OFF by setting the match modifier to <i>i </i>manually.<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT REGEXP_COUNT ('REGEXP_COUNT is a cell level function which operates on each cell individually', '[aeiou]', 1, 'i') regexp_count<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM dual;<o:p></o:p></div>
</div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
26<o:p></o:p></div>
<div class="auto-style7" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Word Count<o:p></o:p></span></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The total number of words in the source string can be found by using the below statement. The search pattern “[^ ]+â€<b> </b>checks for characters other than the space character “[^ ]†followed by one or more non-space characters using the “+†operator.<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT REGEXP_COUNT ('REGEXP_COUNT is introduced in the Oracle version 11gR1', '[^ ]+',1) regexp_count<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM dual;<o:p></o:p></div>
</div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
8<o:p></o:p></div>
<div class="auto-style7" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">Character count<o:p></o:p></span></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The total number of characters in the source string can be found by using the below statement. The search pattern “( . )â€<b> </b>searches for all possible characters in the source string.<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT REGEXP_COUNT ('REGEXP_COUNT is introduced in the Oracle version 11gR1', '(.)', 1) regexp_count<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM dual;<o:p></o:p></div>
</div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
54<o:p></o:p></div>
<div class="auto-style7" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
<span style="font-size: 12pt;">DOT Count<o:p></o:p></span></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The total number of DOT characters in the source string can be found using the below query statement. The search pattern “\.†searches for the literal DOT in the source string. As DOT is a metacharacter, it is escaped using the escape operator backslash “\â€.<o:p></o:p></div>
<div class="auto-style3" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
SELECT REGEXP_COUNT ('There.are.seven.dots.in.this.string.', '\.',1) regexp_count<o:p></o:p></div>
<div class="auto-style4" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
FROM dual;<o:p></o:p></div>
</div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b>Result:<o:p></o:p></b></div>
<div class="auto-style8" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
7<o:p></o:p></div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-39830857309101496072017-08-14T17:21:00.000+05:302017-08-14T17:21:16.124+05:30POSIX Extended Regular Expressions for Oracle<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
POSIX or Portable Operating System Interface for uniX is a set of standards that defines some of the functionality supported by the UNIX operating system. The POSIX standard has three sets of standards. BRE for Basic, ERE for Extended and SRE for Simple Regular Expressions. Most modern regular expressions are extensions of the ERE, also the Oracle regular expression uses these standards only.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Oracle does not completely support the POSIX ERE standard. The POSIX standard states that it is illegal to back reference a character, which is not a metacharacter. Oracle supports this and simply ignores the backslash. For e.g., the string <i>b</i> is not a metacharacter, when it is placed prefixing with a backslash <i>\b</i>, it is similar to the literal <i>b</i>. This means that all POSIX ERE standardized regular expressions can be used with Oracle, but not all the regular expressions, working with Oracle may be supported by fully POSIX ERE supported system.<o:p></o:p></div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 16pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
Regular Expression Metacharacters in Oracle<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Metacharacters are similar to the string literals, but with a special meaning which is used to identify the textual material of the given pattern and to process it using the regular expressions. The below topics defines the different operators in Oracle.<o:p></o:p></div>
<div class="auto-style4" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
POSIX Metacharacters in Oracle<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below list of metacharacters supports the use of regular expressions passed to the SQL regular expression condition and functions. These metacharacters acknowledge to the POSIX standard.<o:p></o:p></div>
<div style="border-bottom: 1pt dotted windowtext; border-image: initial; border-left: none; border-right: none; border-top: none; margin-left: 0.2in; margin-right: 0in; padding: 0in 0in 1pt;">
<div class="auto-style5" style="border-color: inherit; border-style: none; border-width: medium; font-family: "Arial Narrow", sans-serif; font-size: 11pt; font-weight: bold; margin: 6pt 0in 6pt 0.2in; padding: 0in; text-align: justify;">
POSIX Metacharacters List<o:p></o:p></div>
</div>
<table border="1" cellpadding="0" cellspacing="0" class="auto-style6" style="border-collapse: collapse; border: 1pt solid windowtext; font-family: Calibri, sans-serif; font-size: 10pt; margin-left: 0.2in; width: 516px;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Metacharacter<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Description<o:p></o:p></span></b></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">*<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches zero or more occurrences.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">?<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches zero or one occurrence.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">+<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches one or more occurrences.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">|<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches any one of the alternatives. This is similar to the OR operator.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">.<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches any character in the database character set except for Null and the new line character.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">\<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Any metacharacter followed by the backslash symbol is treated as a string literal to search for it. Using double backslash symbol (\\) treats the symbol backslash (\) as a string literal.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">\n<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">This is the backreference expression where n is an integer between 1 and 9, matching the nth reference enclosed between the parenthesis preceding \n.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">^<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches the character in the beginning of the line in a string by default. In multiline mode, it matches the beginning of any line in the source string.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">$<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches the character at the end of the line in a string by default. In multiline mode, it matches the end of any line in the source string.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">(…)<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">This is the grouping expression which treats the expression within the parenthesis as a group. This can be a character literal or an expression with operators.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[…]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">This is the matching expression which specifies a list that matches any of the matches present in the list from the source string.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[^…]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">This is the non-matching expression which specifies a list that does not match with any of the matches present in the list from the source string.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[. Element .]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">This is the collating element operator in the POSIX standard. This operator lets us consider the multi-character collating element to be a single character. For e.g., the string <i>ch</i> comprises of two characters in English, whereas if the language Traditional Spanish is defined in the locale, it will be considered as a single character.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[: Class :]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches any character belonging to the specified character class. For e.g., the class [[:alpha:]] matches all the alphabets in the source string. The below table defines all the classes from the POSIX standard.<o:p></o:p></span></div>
<div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="auto-style9" style="border-collapse: collapse; border: 1pt solid windowtext; font-size: 10pt; width: 383px;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Class<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div align="center" class="auto-style7" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Description<o:p></o:p></span></b></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:alnum:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all alphanumeric characters.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:alpha:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all alphabetic characters.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:blank:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all blank space characters.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:cntrl:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all non-printing control characters.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:digit:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all numeric digits.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:xdigit:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all hexadecimal characters.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:punct:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all punctuation characters.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:upper:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all upper case alphabets.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:lower:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all lower case alphabets.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:graph:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all [[:punct:]], [[:upper:]], [[:lower:]], and [[:digit:]] characters.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:print:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all printable characters.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[[:space:]]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all space characters like carriage return, newline, form feed and vertical tab.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[a-z]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all lower case alphabets. This is similar to [[:lower:]]. To match a set of lower case alphabets, specify a start and an end range. For e.g., [a-m] matches any lower case alphabet between the range <i>a</i> and <i>m </i>in the source string<i>.</i><o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[A-Z]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all upper case alphabets. This is similar to [[:upper:]]. To match a set of upper case alphabets, specify a start and an end range. For e.g., [A-D] matches any uppercase alphabet between the range <i>A</i> and <i>D </i>in the source string.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[0-9]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all numeric digits. This is similar to [[:digits:]]. To match a set of digits, specify a start and an end range. For e.g., [0-5] matches the digits between the range 0 and 5 in the source string.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 61.5pt;" valign="top" width="82"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[A-Za-z0-9]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 225.45pt;" valign="top" width="301"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches all the alphanumeric characters. This is similar to [[:alnum:]]. The combination can be changed as per the requirement like [A-Z0-9], [a-mA-N], [0-7a-oA-H], etc.<o:p></o:p></span></div>
</td></tr>
</tbody></table>
<div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN"><o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">[=Class=]<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">This is the character equivalence class matching all the characters of the same equivalence class in the current locale. For e.g., the expression [=n=] searches for all the characters in the same class like N and ñ from the source string El Niño in a Spanish locale.</span><span lang="EN-IN" style="background: rgb(238, 238, 238); font-family: "Courier New"; font-size: 10pt;"></span><span lang="EN-IN"><o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">{m}<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches exactly m times.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">{m,}<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches at least m times.<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 77pt;" valign="top" width="103"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">{m, n}<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 310.05pt;" valign="top" width="413"><div class="auto-style8" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Matches at least m times, but not more than n times.<o:p></o:p></span></div>
</td></tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Thank you,</div>
<div class="MsoNormal">
Boobal Ganesan</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-48098718233772949132017-08-14T16:22:00.002+05:302017-08-14T16:22:51.477+05:30CASE statements in Oracle PL/SQL<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
CASE Statement<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The CASE statement is similar to an IF-THEN-ELSE statement, but helps in better readability than the later. The CASE statement is also a block with a header and a footer. The header section starts the block with the CASE keyword followed by a series of conditional checks and the footer section ends with an END CASE keyword. There is a mandatory executable statement needed in each of the conditional check section to make the unit free from compilation errors. The CASE statement has optional n number of WHEN-THEN with one or more conditional checks separating each other by conjoining operators (AND) or by include operators (OR), and an ELSE section for the default result output if none of the conditions are satisfied.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The conditional checks in the WHEN-THEN phrases can be of Relational (<, >, <=, >=, <> or !=), Boolean (TRUE, FALSE, NULL)or NULL(IS NULL, IS NOT NULL) comparisons.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div>
<table cellpadding="0" cellspacing="0" hspace="0" style="width: 444px;" vspace="0"><tbody>
<tr><td align="left" style="padding: 9.35pt;" valign="top"><div style="background: rgb(230, 230, 230); border: 3.75pt double windowtext; margin-left: 0.45in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style5" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.7in; padding: 0in; text-align: justify; text-indent: -0.25in;">
<span style="font-family: Wingdings; font-size: 18pt;">%<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span>Note: Static variables or values cannot be compared to a column value from a select statement directly in the WHEN-THEN conditional check, instead the column value has to be assigned to a variable prior to the CASE statement and the two variables can be compared.<o:p></o:p></div>
</div>
</td></tr>
</tbody></table>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
There are two types of CASE statements available in PL/SQL and they are,<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style4" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span><b>Simple CASE</b>: A simple case takes a scalar variable as an expression and compares it with a list of scalar values.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style4" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify; text-indent: -0.25in;">
2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span><b>Searched CASE</b>: A searched case takes a Boolean variable as an expression and compares the Boolean state of the comparison made in the when clause. The default Boolean value is true if not mentioned.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below prototype defines the basic structure of the simple CASE statement.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
CASE <Scalar Variable><o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WHEN <Scalar value1> then<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<Executable statement>;<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WHEN <Scalar value2> then<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<Executable statement>;<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
…<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
ELSE<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<Executable statement>;<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END CASE;<o:p></o:p></div>
</div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
Simple CASE Example<o:p></o:p></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.4in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>SET SERVEROUTPUT ON SIZE 200000<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>DECLARE<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
3.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>l_n_var1 NUMBER:=:value;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
4.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>BEGIN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
5.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>CASE l_n_var1<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
6.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>WHEN 1 THEN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
7.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_output.put_line('The value is 1');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
8.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>WHEN 2 THEN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
9.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_output.put_line('The value is 2');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
10.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>WHEN 3 THEN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
11.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_output.put_line('The value is 3');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
12.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>ELSE<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
13.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_output.put_line('The value is not 1 or 2 or 3');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
14.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>END CASE;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
15.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>END;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
16.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>/<o:p></o:p></div>
</div>
<div class="MsoNormal">
<br /></div>
<div style="border-bottom: 1pt dotted windowtext; border-image: initial; border-left: none; border-right: none; border-top: none; margin-left: 0.2in; margin-right: 0in; padding: 0in 0in 1pt;">
<div class="auto-style9" style="border-color: inherit; border-style: none; border-width: medium; font-family: "Arial Narrow", sans-serif; font-size: 11pt; font-weight: bold; margin: 6pt 0in 6pt 0.2in; padding: 0in; text-align: justify;">
Script Explanation<o:p></o:p></div>
</div>
<table border="1" cellpadding="0" cellspacing="0" class="auto-style14" style="border-collapse: collapse; border: 1pt solid windowtext; font-family: Calibri, sans-serif; font-size: 10pt; margin-left: 0.25in; width: 492px;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div align="center" class="auto-style11" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Line no.<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div align="center" class="auto-style11" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Description<o:p></o:p></span></b></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">This environment variable opens up an output buffer of size limit of 200000<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Start of the DECLARE section of the block<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">3<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">A local variable of the number data type is declared and assigned to a bind variable<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">4<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Start of the Execution section<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">5<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">The CASE statement begins with the scalar variable l_n_var1 as its expression<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">6<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">The scalar variable's value is checked with the value 1 in the WHEN clause<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">7<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If this conditional check is a match, then the result is printed in the form of a printable text using the DBMS_OUTPUT.PUT_LINE procedure<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">8<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If the above conditional check at line 6 does not match, the control shifts to this WHEN section checking the variable with the value 2<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">9<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If this conditional check is a match, then the result is printed in the form of a printable text using the DBMS_OUTPUT.PUT_LINE procedure<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">10<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If the above conditional check at line 8 does not match, the control shifts to this WHEN section checking the variable with the value 3<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">11<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If this conditional check is a match, then the result is printed in the form of a printable text using the DBMS_OUTPUT.PUT_LINE procedure<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">12,13<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If none of the above conditions are matched, the program control is passed on to the ELSE section and prints the default result in the form of a printable text using the DBMS_OUTPUT.PUT_LINE procedure<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">14<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">End of the CASE statement<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">15,16<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 318.3pt;" valign="top" width="424"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">End of the execution section<o:p></o:p></span></div>
</td></tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The below prototype defines the basic structure of the simple CASE statement.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
CASE <Boolean Variable><o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WHEN <variable1> = <variable2> then<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<Executable statement>;<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WHEN <variable1> > <variable2> then<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<Executable statement>;<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
ELSE<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
<Executable statement>;<o:p></o:p></div>
<div class="auto-style6" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END CASE;<o:p></o:p></div>
</div>
<div class="MsoNormal">
<br /></div>
<div class="auto-style3" style="break-after: avoid; font-family: "Arial Narrow", sans-serif; font-size: 14pt; font-weight: bold; margin: 12pt 0in 12pt 0.2in;">
Searched CASE Example<o:p></o:p></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.4in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>SET SERVEROUTPUT ON SIZE 200000<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>DECLARE<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
3.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>l_n_var1 NUMBER:=:value;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
4.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>BEGIN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
5.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>CASE true<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
6.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>WHEN l_n_var1=1 THEN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
7.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_output.put_line('The value is 1');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
8.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>WHEN l_n_var1=2 THEN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
9.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_output.put_line('The value is 2');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
10.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>WHEN l_n_var1=3 THEN<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
11.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_output.put_line('The value is 3');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
12.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>ELSE<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
13.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>dbms_output.put_line('The value is not 1 or 2 or 3');<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
14.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>END CASE;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
15.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>END;<o:p></o:p></div>
<div class="auto-style7" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in; text-indent: -0.25in;">
16.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span>/<o:p></o:p></div>
</div>
<div class="auto-style8" style="font-family: Garamond, serif; font-size: 14pt; margin: 0in 0in 0.0001pt 35.4pt;">
<br /></div>
<div style="border-bottom: 1pt dotted windowtext; border-image: initial; border-left: none; border-right: none; border-top: none; margin-left: 0.2in; margin-right: 0in; padding: 0in 0in 1pt;">
<div class="auto-style9" style="border-color: inherit; border-style: none; border-width: medium; font-family: "Arial Narrow", sans-serif; font-size: 11pt; font-weight: bold; margin: 6pt 0in 6pt 0.2in; padding: 0in; text-align: justify;">
Script Explanation<o:p></o:p></div>
</div>
<table border="1" cellpadding="0" cellspacing="0" class="auto-style10" style="border-collapse: collapse; border: 1pt solid windowtext; font-family: Calibri, sans-serif; font-size: 10pt; margin-left: 0.2in; width: 496px;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div align="center" class="auto-style11" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Line no.<o:p></o:p></span></b></div>
</td><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; border-right: 1pt solid windowtext; border-top: 1pt solid windowtext; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div align="center" class="auto-style11" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span lang="EN-IN">Description<o:p></o:p></span></b></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">1<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">This environment variable opens up an output buffer of size limit of 200000<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">2<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Start of the DECLARE section of the block<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">3<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">A local variable of the number data type is declared and assigned to a bind variable<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">4<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">Start of the Execution section<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">5<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">The CASE statement begins with the Boolean value True as its expression<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">6<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">The scalar variable's value is equated with the value 1 in the WHEN clause<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">7<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If this conditional check is a match, then the result is printed in the form of a printable text using the DBMS_OUTPUT.PUT_LINE procedure<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">8<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If the above conditional check at line 6 does not match, the control shifts to this WHEN section equating the variable with the value 2<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">9<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If this conditional check is a match, then the result is printed in the form of a printable text using the DBMS_OUTPUT.PUT_LINE procedure<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">10<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If the above conditional check at line 8 does not match, the control shifts to this WHEN section checking the variable with the value 3<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">11<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If this conditional check is a match, then the result is printed in the form of a printable text using the DBMS_OUTPUT.PUT_LINE procedure<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">12,13<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">If none of the above conditions are matched, the program control is passed on to the ELSE section and prints the default result in the form of a printable text using the DBMS_OUTPUT.PUT_LINE procedure<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">14<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">End of the CASE statement<o:p></o:p></span></div>
</td></tr>
<tr><td style="border-bottom: 1pt solid windowtext; border-image: initial; border-left: 1pt solid windowtext; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 50.45pt;" valign="top" width="67"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">15,16<o:p></o:p></span></div>
</td><td style="border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; padding: 0in 5.4pt; width: 321.9pt;" valign="top" width="429"><div class="auto-style12" style="font-family: "Arial Narrow", sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt;">
<span lang="EN-IN">End of the execution section</span></div>
</td></tr>
</tbody></table>
<br /><br /><div>
Thank you,</div>
<div>
Boobal Ganesan</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0tag:blogger.com,1999:blog-5666492602651179872.post-53595709242930058582017-08-14T16:20:00.001+05:302017-08-16T03:15:13.266+05:30PL/SQL FORMAT_ERROR_BACKTRACE Tips<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Hello All,</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
To find the exact position where the exception has occurred is always a tough job for the programmers to identify. To rectify this issue, a procedure FORMAT_ERROR_BACKTRACE in the DBMS_UTILITY package has been introduced in the Oracle version 10g. This procedure back traces the exception by propagating through the nested programs to bring in the exact route of the exception propagation.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
In the below code snippet, the predefined exception NO_DATA_FOUND has been explicitly raised to capture the error code using both the SQLCODE and the back trace procedures.<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div style="background: rgb(230, 230, 230); border: 1pt dotted windowtext; margin-left: 0.2in; margin-right: 0in; padding: 1pt 4pt;">
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
BEGIN<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
raise no_data_found;<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
EXCEPTION<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
WHEN OTHERS THEN<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
dbms_output.put_line('Backtrace => '||dbms_utility.format_error_backtrace);<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
dbms_output.put_line('SQLCODE => '||SQLCODE);<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
END;<o:p></o:p></div>
<div class="auto-style3" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: inherit; border-style: none; border-width: medium; font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in; padding: 0in;">
/<o:p></o:p></div>
</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style4" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<b><br /></b>
<b>Result:<o:p></o:p></b></div>
<div class="auto-style4" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
<br /></div>
<div class="auto-style4" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
Backtrace => ORA-06512: at line 2<o:p></o:p></div>
<div class="auto-style4" style="font-family: "Courier New"; font-size: 8pt; margin: 0in 0in 0.0001pt 0.2in;">
SQLCODE => 100<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<span style="font-size: 11pt;">The above result shows that the back trace procedure has produced the line number along with the ORA error code, whereas the SQLCODE procedure provided us with much less information.</span><br />
<o:p></o:p></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
The failure of the SQLERRM procedure to truncate the error message more than 512 characters lead us to the creation of FORMAT_ERROR_STACK procedure of the utility package which allows us to print up to 2000 characters without any truncation. This utility procedure is very much advantageous during the RAISE_APPLICATION_ERROR call with the third optional parameter is set to True which stacks up the error messages.</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
<br /></div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Thank you,</div>
<div class="auto-style1" style="font-family: Garamond, serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.2in; text-align: justify;">
Boobal Ganesan</div>
</div>
Anonymoushttp://www.blogger.com/profile/06735225277182790976noreply@blogger.com0