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

292 lines
28 KiB
HTML

<a name="EN-US_TOPIC_0000001233800665"></a><a name="EN-US_TOPIC_0000001233800665"></a>
<h1 class="topictitle1">Regular Expression Functions</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p688119794310">Regular expressions specify patterns to match strings using standardized syntax conventions. In Oracle, regular expressions are implemented using a set of SQL functions that allow you to search and use string data.</p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p3299131124818">DSC can migrate <a href="#EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section367618918273">REGEXP_INSTR</a>, <a href="#EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section9584371501">REGEXP_SUBSTR</a>, and <a href="#EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section0549591474">REGEXP_REPLACE</a> regular expressions. Details are as follows:</p>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul11121226112619"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li87871736133315">Regexp (REGEXP_INSTR and REGEXP_SUBSTR) that includes the <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b119363412327">sub_expr </strong>parameter are not supported. If the input script includes <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b1859003113212">sub_expr</strong>, the DSC will log an error for it.</li><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li185081021102816">Regexp (REGEXP_INSTR, REGEXP_SUBSTR, and REGXP_REPLACE) uses the <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b1998313393326">match_param</strong><em id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_i3332239103210"> </em>parameter to set the default matching behavior. The DSC supports values i (case-insensitive) and c (case-sensitive) for this parameter. Other values for <strong id="EN-US_TOPIC_0000001233800665__b168792218258">match_param</strong><em id="EN-US_TOPIC_0000001233800665__i38722252517"> </em>are not supported.</li><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li68471144316">Regexp (REGEXP_INSTR) uses the <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b053213541324">return_option</strong><em id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_i1275654103219"> </em>parameter to set what is returned for regexp. The DSC supports the value 0 (zero) for this parameter. Other values for return_option are not supported.</li></ul>
<div class="section" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section367618918273"><a name="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section367618918273"></a><a name="en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section367618918273"></a><h4 class="sectiontitle">REGEXP_INSTR</h4><p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p025617773914">REGEXP_INSTR extends the functionality of the INSTR function by supporting the regular expression pattern for the search string. REGEXP_INSTR with 2 to 6 parameters are supported for migration.</p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p161403414184">The <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b42311410374">sub_expr</strong> parameter (parameter #7) is available in Oracle but is not supported for migration. If the input script includes <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b10990151311377">sub_expr</strong>, the DSC will log an error for it.</p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p0531525175912">For <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b019917214378">return_option</strong>, the value 0 (zero) is supported. Other values for return_option are not supported.</p>
<div class="p" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p053132525912">For <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b19952826153711">match_param</strong>, values i (case-insensitive) and c (case-sensitive) are supported. Other values for <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b86718363372">match_param</strong><em id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_i1433753513711"> </em>are not supported.<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen32758727">REGEXP_INSTR(
string,
pattern,
[start_position,]
[nth_appearance,]
[return_option,]
[match_param,]
[sub_expr]
)</pre>
</div>
</div>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p964961610437"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b1194142524512">Bulk Operations</strong></p>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul6690729104511"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li12690192914516"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b18690182919455">Input - REGEXP_INSTR</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen46081633192614">SELECT
REGEXP_INSTR( 'TechOnTheNet is a great resource' ,'t' )
FROM
dual
;</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p51688209272"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b1258603145311">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen1416872032714">SELECT
MIG_ORA_EXT.REGEXP_INSTR (
'TechOnTheNet is a great resource'
,'t'
)
FROM
dual
;</pre>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul17219111044710"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li321981014479"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b1121911016474">Input - REGEXP_INSTR with 7 parameters</strong> <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b15423101425216">(Invalid)</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen121961019477">SELECT
Empno
,ename
,REGEXP_INSTR( ename ,'a|e|i|o|u' ,1 ,1 ,0 ,'i' ,7 ) AS Dname
FROM
emp19
;</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p172201410194711"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b1122013107474">Output</strong></p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p5752154811520">The input expression has 7 parameters. Since the tool supports REGEXP_INSTR with 2 to 6 arguments, an error will be logged, starting "<em id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_i15577515411">Seven(7) arguments for REGEXP_INSTR function is not supported.</em>"</p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen1522012105479">SELECT
Empno
,ename
,REGEXP_INSTR( ename ,'a|e|i|o|u' ,1 ,1 ,0 ,'i' ,7 ) AS Dname
FROM
emp19
;</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p8372316155617"></p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p18684727205619"><strong id="EN-US_TOPIC_0000001233800665__b13104191852610">BLogic Operations</strong></p>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul9684327195614"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li186845272566"><strong id="EN-US_TOPIC_0000001233800665__b1428617611">Input - REGEXP_INSTR</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen36851327145618">CREATE OR REPLACE FUNCTION myfct
RETURN VARCHAR2
IS
res VARCHAR2(200) ;
BEGIN
res := 100 ;
INSERT INTO emp19 RW(RW.empno,RW.ename,dname) SELECT res, RWN.ename key
, regexp_instr(ename ,'[ae]',4,2,0, 'i') as Dname FROM emp19 RWN ;
RETURN res ;
END ;
/</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p86869271566"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b76871427125617">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen968717277568">CREATE
OR REPLACE FUNCTION myfct RETURN VARCHAR2 IS res VARCHAR2 ( 200 ) ;
BEGIN
res := 100 ;
INSERT INTO emp19 ( empno ,ename ,dname ) SELECT
res ,RWN.ename "KEY" ,MIG_ORA_EXT.REGEXP_INSTR ( ename ,'[ae]' ,4 ,2 ,0 ,'i' ) as Dname
FROM
emp19 RWN ;
RETURN res ; END ;
/</pre>
<div class="section" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section9584371501"><a name="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section9584371501"></a><a name="en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section9584371501"></a><h4 class="sectiontitle">REGEXP_SUBSTR</h4><p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p26311753183912">REGEXP_SUBSTR extends the functionality of the SUBSTR function by supporting regular expression pattern for the search string. REGEXP_SUBSTR with 2 to 5 parameters are supported for migration.</p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p9615452176">The <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b14686194444114">sub_expr</strong> parameter (parameter #6) is available in Oracle but is not supported for migration. If the input script includes <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b143417513413">sub_expr</strong>, the DSC will log an error for it.</p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p8863102218434">For <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b136153414214">match_param</strong>, values i (case-insensitive) and c (case-sensitive) are supported. Other values for <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b1135917581417">match_param</strong><em id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_i197761057164116"> </em>are not supported.</p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen7541735">REGEXP_SUBSTR(
string,
pattern,
[start_position,]
[nth_appearance,]
[match_param,]
[sub_expr]
)</pre>
</div>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p10592372016"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b860193714017">Bulk Operations</strong></p>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul19605371109"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li176003712017"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b5611537100">Input - REGEXP_SUBSTR</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen3611037904">SELECT
Ename
,REGEXP_SUBSTR( 'Programming' ,'(\w).*?\1' ,1 ,1 ,'i' )
FROM
emp16
;</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p1764537408"><strong id="EN-US_TOPIC_0000001233800665__b1906990702">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen136417371308">SELECT
Ename
,MIG_ORA_EXT.REGEXP_SUBSTR (
'Programming'
,'(\w).*?\1'
,1
,1
,'i'
)
FROM
emp16
;</pre>
<div class="p" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p119681615143913"><ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul18136723131516"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li2137523111519"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b11140172361518">Input - REGEXP_SUBSTR</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen8140132312150">SELECT
REGEXP_SUBSTR( '1234567890' ,'(123)(4(56)(78))' ,1 ,1 ,'i' ) "REGEXP_SUBSTR"
FROM
DUAL
;</pre>
</div>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p4150122311159"><strong id="EN-US_TOPIC_0000001233800665__b613410601">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen715119238153">SELECT
MIG_ORA_EXT.REGEXP_SUBSTR (
'1234567890'
,'(123)(4(56)(78))'
,1
,1
,'i'
) "REGEXP_SUBSTR"
FROM
DUAL
;</pre>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul1868173719015"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li116853711016"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b36910372018">Input - REGEXP_SUBSTR with 6 parameters</strong> <strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b11691237502">(Invalid)</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen47010371809">SELECT
REGEXP_SUBSTR( '1234567890' ,'(123)(4(56)(78))' ,1 ,1 ,'i' ,1 ) "REGEXP_SUBSTR"
FROM
DUAL
;</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p197412376020"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b47515372013">Output</strong></p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p775337907">The input expression has 6 arguments. Since the tool supports REGEXP_SUBSTR with 2 to 5 parameters an error will be logged, starting "<em id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_i4901110455">Error message :Six(6) arguments for REGEXP_SUBSTR function is not supported.</em>"</p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen14161250110">SELECT
REGEXP_SUBSTR( '1234567890' ,'(123)(4(56)(78))' ,1 ,1 ,'i' ,1 ) "REGEXP_SUBSTR"
FROM
DUAL
;</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p1381163719013"></p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p168211372004"><strong id="EN-US_TOPIC_0000001233800665__b4488155862610">BLogic Operations</strong></p>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul148233717015"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li15839371704"><strong id="EN-US_TOPIC_0000001233800665__b1461769787">Input - REGEXP_SUBSTR</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen118419371200">CREATE OR REPLACE FUNCTION myfct
RETURN VARCHAR2
IS
res VARCHAR2(200) ;
BEGIN
res := 100 ;
INSERT INTO emp19 RW(RW.empno,RW.ename,dname) SELECT res, RWN.ename key
,REGEXP_ SUBSTR ('TechOnTheNet', 'a|e|i|o|u', 1, 1, 'i') as Dname FROM emp19 RWN ;
RETURN res ;
END ;
/</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p10871371707"><strong id="EN-US_TOPIC_0000001233800665__b762131913">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen68723712010">CREATE
OR REPLACE FUNCTION myfct RETURN VARCHAR2 IS res VARCHAR2 ( 200 ) ;
BEGIN
res := 100 ;
INSERT INTO emp19 ( empno ,ename ,dname ) SELECT
res ,RWN.ename "KEY" ,MIG_ORA_EXT.REGEXP_ SUBSTR ( 'TechOnTheNet' ,'a|e|i|o|u' ,1 ,1 ,'i' ) as Dname
FROM
emp19 RWN ;
RETURN res ;
END ;
/</pre>
<div class="section" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section0549591474"><a name="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section0549591474"></a><a name="en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section0549591474"></a><h4 class="sectiontitle">REGEXP_REPLACE</h4><p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p142193141617">REGEXP_REPLACE extends the functionality of the REPLACE function by supporting regular expression pattern for the search string. REGEXP_REPLACE with 2 to 6 parameters are supported for migration.</p>
</div>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p267392624716">For <strong id="EN-US_TOPIC_0000001233800665__b1838076843">match_param</strong>, values i (case-insensitive) and c (case-sensitive) are supported. Other values for <strong id="EN-US_TOPIC_0000001233800665__b1958310092">match_param</strong><em id="EN-US_TOPIC_0000001233800665__i759424624"> </em>are not supported.</p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen2529132514325">REGEXP_REPLACE(
string,
pattern,
[replacement_string,]
[start_position,]
[nth_appearance,]
[match_param]
)</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p14551129270"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b125518918714">Bulk Operations</strong></p>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul85521895716"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li135521895718"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b4431144216185">Input - REGEXP_REPLACE</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen1655413919714">SELECT
testcol
,regexp_replace( testcol ,'([[:digit:]]{3})\.([[:digit:]]{3})\.([[:digit:]]{4})' ,'(\1) \2-\3' ) RESULT
FROM
test
WHERE
LENGTH( testcol ) = 12
;</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p6560149875"><strong id="EN-US_TOPIC_0000001233800665__b907095381">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen1485531213213">SELECT
testcol
,MIG_ORA_EXT.REGEXP_REPLACE (
testcol
,'([[:digit:]]{3})\.([[:digit:]]{3})\. ([[:digit:]]{4})'
,'(\1) \2-\3'
) RESULT
FROM
test
WHERE
LENGTH( testcol ) = 12
;</pre>
<div class="p" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p5996915173911"><ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul242784281814"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li17429184201810"><strong id="EN-US_TOPIC_0000001233800665__b10582163118299">Input - REGEXP_REPLACE</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen114321542151812">SELECT
UPPER( regexp_replace ( 'foobarbequebazilbarfbonk barbeque' ,'(b[^b]+)(b[^b]+)' ) )
FROM
DUAL
;</pre>
</div>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p12442742121810"><strong id="EN-US_TOPIC_0000001233800665__b9919125513272">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen8447164261818">SELECT
UPPER( MIG_ORA_EXT.REGEXP_REPLACE ( 'foobarbequebazilbarfbonk barbeque' ,'(b[^b]+)(b[^b]+)' ) )
FROM
DUAL
;</pre>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul16566091879"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li16701565183"><strong id="EN-US_TOPIC_0000001233800665__b1863413872811">Input - REGEXP_REPLACE with 7 parameters</strong> <strong id="EN-US_TOPIC_0000001233800665__b1563410389283">(Invalid)</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen15568191878">SELECT
REGEXP_REPLACE( 'TechOnTheNet' ,'a|e|i|o|u' ,'Z' ,1 ,1 ,'i' ,'(\1) \2-\3' ) AS First_Occurrence
FROM
emp
;</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p115711093710"><strong id="EN-US_TOPIC_0000001233800665__b1861320478292">Output</strong></p>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p17572189775">The input expression has 7 parameters. Since the tool supports REGEXP_REPLACE with 2 to 6 parameters, an error will be logged, starting "<em id="EN-US_TOPIC_0000001233800665__i134016528298">Too many arguments for REGEXP_REPLACE function [Max:6 argument(s) is/are allowed].</em>"</p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen2057319911712">SELECT
REGEXP_REPLACE( 'TechOnTheNet' ,'a|e|i|o|u' ,'Z' ,1 ,1 ,'i' ,'(\1) \2-\3' ) AS First_Occurrence
FROM
emp
;</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p157699873"><strong id="EN-US_TOPIC_0000001233800665__b1692532304">BLogic Operations</strong></p>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul1957718912718"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li1357814915714"><strong id="EN-US_TOPIC_0000001233800665__b19335886305">Input - REGEXP_REPLACE</strong></li></ul>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen25790914718">CREATE OR REPLACE FUNCTION myfct
RETURN VARCHAR2
IS
res VARCHAR2(200) ;
BEGIN
res := 100 ;
INSERT INTO emp19 RW(RW.empno,RW.ename,dname) SELECT res, RWN.ename key
,REGEXP_REPLACE ('TechOnTheNet', 'a|e|i|o|u', 'Z', 1, 1, 'i') as Dname FROM emp19 RWN ;
RETURN res ;
END ;
/</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p158514918716"><strong id="EN-US_TOPIC_0000001233800665__b16485141483020">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen9586119477">CREATE
OR REPLACE FUNCTION myfct RETURN VARCHAR2 IS res VARCHAR2 ( 200 ) ;
BEGIN
res := 100 ;
INSERT INTO emp19 ( empno ,ename ,dname ) SELECT
res ,RWN.ename "KEY" ,MIG_ORA_EXT.REGEXP_REPLACE ( 'TechOnTheNet' ,'a|e|i|o|u' ,'Z' ,1 ,1 ,'i' ) as Dname
FROM
emp19 RWN ;
RETURN res ;
END ;
/</pre>
<div class="section" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_section165161830112516"><h4 class="sectiontitle">LISTAGG/regexp_replace/regexp_instr</h4><p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p635715273268">Configure the following parameters before migrating LISTAGG/regexp_replace/regexp_instr:</p>
<ul id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_ul11357927172610"><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li7357112722615">MigSupportForListAgg=false</li><li id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_li0357152712612">MigSupportForRegexReplace=false</li></ul>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p16357142722613"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b83571627122617">Input- REMOVE LISTAGG/regexp_replace/regexp_instr</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen93571527192612">SELECT LISTAGG(T.OS_SOFTASSETS_ID,',') WITHIN GROUP(ORDER BY T.SOFTASSETS_ID)
INTO V_OS_SOFTASSETS_IDS
FROM SPMS_SYSSOFT_PROP_APPR T
WHERE T.APPR_ID = I_APPR_ID
AND T.SYSSOFT_PROP = '001';
V_ONLY_FILE_NAME := REGEXP_REPLACE( I_FILENAME ,'.*/' ,'' ) ;
THEN v_auth_type := 102;
ELSIF v_status IN ('0100', '0200')
AND REGEXP_INSTR (v_role_str, ',(411|414),') &gt; 0</pre>
<p id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_p5357122719264"><strong id="EN-US_TOPIC_0000001233800665__en-us_topic_0237712555_b15298151973912">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233800665__en-us_topic_0238518400_en-us_topic_0237362432_en-us_topic_0202727114_screen1935792719269">"SELECT LISTAGG(T.OS_SOFTASSETS_ID,',') WITHIN GROUP(ORDER BY T.SOFTASSETS_ID)
INTO V_OS_SOFTASSETS_IDS
FROM SPMS_SYSSOFT_PROP_APPR T
WHERE T.APPR_ID = I_APPR_ID
AND T.SYSSOFT_PROP = '001';
V_ONLY_FILE_NAME := REGEXP_REPLACE (I_FILENAME, '.*/', '');
THEN v_auth_type := 102;
ELSIF v_status IN ('0100', '0200')
AND REGEXP_INSTR (v_role_str, ',(411|414),') &gt; 0"</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_mt_0133.html">System Functions</a></div>
</div>
</div>