forked from laiweijian4/doc-exports
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>
189 lines
22 KiB
HTML
189 lines
22 KiB
HTML
<a name="EN-US_TOPIC_0000001188362604"></a><a name="EN-US_TOPIC_0000001188362604"></a>
|
|
|
|
<h1 class="topictitle1">LOB Functions</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p458713207218">This section describes the following LOB functions:</p>
|
|
<ul id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_ul182229515017"><li id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_li112221051601"><a href="#EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section176241039144113">DBMS_LOB.APPEND</a></li><li id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_li51707521606"><a href="#EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section6217151214426">DBMS_LOB.COMPARE</a></li><li id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_li182071587020"><a href="#EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section1178018136439">DBMS_LOB.CREATETEMPORARY</a></li><li id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_li09037211119"><a href="#EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section47241940124312">DBMS_LOB.INSTR</a></li><li id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_li166771771313"><a href="#EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section1399115814436">DBMS_LOB.SUBSTR</a></li></ul>
|
|
<div class="section" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section176241039144113"><a name="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section176241039144113"></a><a name="en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section176241039144113"></a><h4 class="sectiontitle">DBMS_LOB.APPEND</h4><p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p1714218710256"><strong id="EN-US_TOPIC_0000001188362604__b1386162120718">DBMS_LOB.APPEND</strong> function appends the content of a source LOB to a specified LOB.</p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p3530127103810"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b4530227123815">Input - <strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b1253092753815">DBMS_LOB.APPEND</strong></strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen35301027193816">[sys.]dbms_lob.append(o_menuxml, to_clob('DSJKSDAJKSFDA'));</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p95301427103810"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b115307271387">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen1953072714381">o_menuxml := CONCAT(o_menuxml, CAST('DSJKSDAJKSFDA' AS CLOB));</pre>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p166480241707"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b1165012246011">Input - <strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b96509241102">DBMS_LOB.APPEND</strong></strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen86511224402">CREATE
|
|
OR REPLACE PROCEDURE append_example IS clobSrc CLOB ;
|
|
clobDest CLOB ;
|
|
BEGIN
|
|
SELECT
|
|
clobData INTO clobSrc
|
|
FROM
|
|
myTable
|
|
WHERE
|
|
id = 2 ;
|
|
SELECT
|
|
clobData INTO clobDest
|
|
FROM
|
|
myTable
|
|
WHERE
|
|
id = 1 ;
|
|
readClob ( 1 ) ;
|
|
DBMS_LOB.APPEND ( clobDest ,clobSrc ) ;
|
|
readClob ( 1 ) ;
|
|
END append_example ;
|
|
/</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p1565262411017"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b1065372413016">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen2653624807">CREATE
|
|
OR REPLACE PROCEDURE append_example IS clobSrc CLOB ;
|
|
clobDest CLOB ;
|
|
BEGIN
|
|
SELECT
|
|
clobData INTO clobSrc
|
|
FROM
|
|
myTable
|
|
WHERE
|
|
id = 2 ;
|
|
SELECT
|
|
clobData INTO clobDest
|
|
FROM
|
|
myTable
|
|
WHERE
|
|
id = 1 ;
|
|
readClob ( 1 ) ;
|
|
clobDest := CONCAT( clobDest ,clobSrc ) ;
|
|
readClob ( 1 ) ;
|
|
end ;
|
|
/</pre>
|
|
<div class="section" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section6217151214426"><a name="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section6217151214426"></a><a name="en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section6217151214426"></a><h4 class="sectiontitle">DBMS_LOB.COMPARE</h4><p id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_p13229105313125"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b7229135341218">DBMS_LOB.COMPARE</strong> is an Oracle system function and is not implicitly supported by <span id="EN-US_TOPIC_0000001188362604__text1958020141713">GaussDB(DWS)</span>.</p>
|
|
<p id="EN-US_TOPIC_0000001188362604__p1211416191611">This function is used to compare the full/partial content of two LOBs. To support this feature, use DSC to create a <strong id="EN-US_TOPIC_0000001188362604__b77921016104310">COMPARE</strong> function in the <strong id="EN-US_TOPIC_0000001188362604__b149043217436">MIG_ORA_EXT</strong> schema. The migrated statements will use the new function <strong id="EN-US_TOPIC_0000001188362604__b179511141124310">MIG_ORA_EXT.MIG_CLOB_COMPARE</strong>, and the examples of using functions in SQL statements are shown as follows.</p>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p42791906618"><strong id="EN-US_TOPIC_0000001188362604__b410512444162">COMPARE in SQL</strong></p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p1883214528244"><strong id="EN-US_TOPIC_0000001188362604__b1576855212165">Input - <strong id="EN-US_TOPIC_0000001188362604__b7768652101617">DBMS_LOB.COMPARE</strong></strong><strong id="EN-US_TOPIC_0000001188362604__b1676819528167"> in SQL</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen183213522241">SELECT a.empno ,dbms_lob.compare ( col1 ,col2 ) FROM emp a ,emp b ;</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p1583417522244"><strong id="EN-US_TOPIC_0000001188362604__b891952763">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen483475215243">SELECT a.empno ,MIG_ORA_EXT.MIG_CLOB_COMPARE ( col1 ,col2 ) FROM emp a ,emp b ;</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p1693119391592"><strong id="EN-US_TOPIC_0000001188362604__b193219415175">Input - <strong id="EN-US_TOPIC_0000001188362604__b0321341176">DBMS_LOB.COMPARE</strong></strong><strong id="EN-US_TOPIC_0000001188362604__b9322949177"> in SQL with CREATE TABLE using 5 parameters</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen1779916176176">CREATE TABLE abc nologging AS SELECT dbms_lob.compare ( col1 ,col2 ,3 ,5 ,4 ) FROM emp a ,emp b ;</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p67998172173"><strong id="EN-US_TOPIC_0000001188362604__b434451438">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen98002017111719">CREATE UNLOGGED TABLE abc AS ( SELECT MIG_ORA_EXT.MIG_CLOB_COMPARE ( col1 ,col2 ,3 ,5 ,4 ) FROM emp a ,emp b ) ;</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p1821145517595"><strong id="EN-US_TOPIC_0000001188362604__b1754291613172">Input - <strong id="EN-US_TOPIC_0000001188362604__b7542216121713">DBMS_LOB.COMPARE</strong></strong><strong id="EN-US_TOPIC_0000001188362604__b1254201612177"> in SQL of a function (NVL2)</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen544922712191">SELECT REPLACE( NVL2( DBMS_LOB.COMPARE ( ENAME ,Last_name ) ,'NO NULL' ,'ONE NULL' ) ,'NULL' ) FROM emp ;</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p174491327121917"><strong id="EN-US_TOPIC_0000001188362604__b675857371">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen645019273192">SELECT REPLACE( DECODE ( MIG_ORA_EXT.MIG_CLOB_COMPARE ( ENAME ,Last_name ) ,NULL ,'ONE NULL' ,'NO NULL' ) ,'NULL' ,'' ) FROM emp ;</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p0641181210616"><strong id="EN-US_TOPIC_0000001188362604__b4804142515177">COMPARE in PL/SQL</strong></p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p58378261535"><strong id="EN-US_TOPIC_0000001188362604__b6517329171714">Input - <strong id="EN-US_TOPIC_0000001188362604__b7517132917177">DBMS_LOB.COMPARE</strong></strong><strong id="EN-US_TOPIC_0000001188362604__b6517729131711"> in PL/SQL</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen655656184312">declare v_clob clob;
|
|
v_text varchar(1000);
|
|
v_compare_res INT;
|
|
BEGIN
|
|
v_clob := TO_CLOB('abcddedf');
|
|
v_text := '123454';
|
|
v_compare_res := dbms_lob.compare(v_clob, TO_CLOB(v_text));
|
|
DBMS_OUTPUT.PUT_LINE(v_compare_res);
|
|
end;
|
|
/</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p23676427517"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b0364133354313">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen165571965437">declare v_clob clob;
|
|
v_text varchar(1000);
|
|
v_compare_res INT;
|
|
BEGIN
|
|
v_clob := CAST('abcddedf' AS CLOB);
|
|
v_text := '123454';
|
|
v_compare_res := MIG_ORA_EXT.MIG_CLOB_COMPARE(v_clob,cast(v_text as CLOB));
|
|
DBMS_OUTPUT.PUT_LINE(v_compare_res);
|
|
end;
|
|
/</pre>
|
|
<div class="section" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section1178018136439"><a name="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section1178018136439"></a><a name="en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section1178018136439"></a><h4 class="sectiontitle">DBMS_LOB.CREATETEMPORARY</h4><p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p28161050194512">The DBMS_LOB.CREATETEMPORARY function creates a temporary LOB and its corresponding index in the default temporary tablespace. DBMS_LOB.FREETEMPORARY is used to delete the temporary LOB and its index.</p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p178865391260"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b636113394318">Input - <strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b33612335439">DBMS_LOB.CREATETEMPORARY with DBMS_LOB.FREETEMPORARY</strong></strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen168885391368">declare v_clob clob;
|
|
begin
|
|
DBMS_LOB.CREATETEMPORARY(v_clob, TRUE, DBMS_LOB.SESSION);
|
|
v_clob := TO_CLOB('abcddedf');
|
|
DBMS_OUTPUT.PUT_LINE(v_clob);
|
|
DBMS_LOB.FREETEMPORARY(v_clob);
|
|
end;
|
|
/</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p1690312394618"><strong id="EN-US_TOPIC_0000001188362604__b1317710171">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen14904939167">declare v_clob clob;
|
|
begin
|
|
-- DBMS_LOB.CREATETEMPORARY(v_clob, TRUE, DBMS_LOB.SESSION);
|
|
v_clob := CAST('abcddedf' AS CLOB);
|
|
DBMS_OUTPUT.PUT_LINE(CAST(v_clob AS TEXT));
|
|
-- DBMS_LOB.FREETEMPORARY(v_clob);
|
|
NULL;
|
|
end;
|
|
/</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section1877844918447"><h4 class="sectiontitle">DBMS_LOB.FREETEMPORARY</h4><p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p13324135144416">The DBMS_LOB.FREETEMPORARY function frees the temporary BLOB or CLOB in the default temporary tablespace. After the call to FREETEMPORARY, the LOB locator that is freed is marked as invalid.</p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p193271351124411"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b19327751194412">Input - <strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b73285515444">DBMS_LOB.CREATETEMPORARY and DBMS_LOB.FREETEMPORARY</strong></strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen7329185174418">declare v_clob clob;
|
|
begin
|
|
DBMS_LOB.CREATETEMPORARY(v_clob, TRUE, DBMS_LOB.SESSION);
|
|
v_clob := TO_CLOB('abcddedf');
|
|
DBMS_OUTPUT.PUT_LINE(v_clob);
|
|
DBMS_LOB.FREETEMPORARY(v_clob);
|
|
end;
|
|
/</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p43381514445"><strong id="EN-US_TOPIC_0000001188362604__b1501900657">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen1377954919449">declare v_clob clob ;
|
|
BEGIN
|
|
/*DBMS_LOB.CREATETEMPORARY(v_clob, TRUE, DBMS_LOB.SESSION);*/
|
|
v_clob := cast( 'abcddedf' as CLOB ) ;
|
|
DBMS_OUTPUT.PUT_LINE ( v_clob ) ;
|
|
/* DBMS_LOB.FREETEMPORARY(v_clob); */
|
|
null ;
|
|
end ;
|
|
/</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section47241940124312"><a name="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section47241940124312"></a><a name="en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section47241940124312"></a><h4 class="sectiontitle">DBMS_LOB.INSTR</h4><p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p2390542117050">DBMS_LOB.INSTR function returns the matching position of the n<sup id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_sup890135312518">th</sup> occurrence of the pattern in the LOB, starting from the offset specified.</p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p323212478814"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b395620562307">Input - <strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b7484228183614">DBMS_LOB.INSTR</strong></strong><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b137185718363"> in SQL</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen4957125623017">SELECT expr1, …, DBMS_LOB.INSTR(str, septr, 1, 5)
|
|
FROM tab1
|
|
WHERE …;</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p17957145613013"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b19574562303">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen139581556143012">SELECT expr1, …, INSTR(str, septr, 1, 5)
|
|
FROM tab1
|
|
WHERE …</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p6181191433019"></p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p10781481490"><strong id="EN-US_TOPIC_0000001188362604__b26343631814">Input - <strong id="EN-US_TOPIC_0000001188362604__b163836161813">DBMS_LOB.INSTR</strong></strong><strong id="EN-US_TOPIC_0000001188362604__b1063183621816"> in PL/SQL</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen4392756361">BEGIN
|
|
…
|
|
pos := DBMS_LOB.INSTR(str,septr,1, i);
|
|
...
|
|
END;
|
|
/</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p9402756762"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b162971956114316">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen940310561266">BEGIN
|
|
…
|
|
pos := INSTR(str,septr,1, i);
|
|
...
|
|
END;
|
|
/</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section1399115814436"><a name="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section1399115814436"></a><a name="en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_section1399115814436"></a><h4 class="sectiontitle">DBMS_LOB.SUBSTR</h4><p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p56542858165932">DBMS_LOB.SUBSTR is supported in V1R8C10. You can specify whether to migrate this fucntion by configuring parameter <strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b338661915157">MigDbmsLob</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p57441115218"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b16988193915210">Input - DBMS_LOB.SUBSTR</strong><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b16988193910520"> when MigDbmsLob is set to true</strong></p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p1935523412410">If<strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b6214114316420"> </strong>the value of <strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b947661420168">MigDbmsLob</strong> is <strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b439617242161">true</strong>, then migration happens. If the value is <strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b138531427191712">false</strong>, then migration does not happen.</p>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p730962132712"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b1950512772719">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen65343172710">select dbms_lob.substr('!2d3d4dd!',1,5);</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p93811313154116"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b12587131212280">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen1729852014285">If the config param is true, it should be migrated as below:
|
|
select substr('!2d3d4dd!',5,1);
|
|
|
|
If false, it should be retained as it is:
|
|
select dbms_lob.substr('!2d3d4dd!',1,5);</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p18610922185018"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b9610192219501">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen96101022165017">select dbms_lob.substr('!2d3d4dd!',5);</pre>
|
|
<p id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_p0610522185018"><strong id="EN-US_TOPIC_0000001188362604__en-us_topic_0237712332_b106101622185011">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362604__en-us_topic_0238518397_en-us_topic_0237362225_en-us_topic_0202727205_screen10610822125017">If the config param is true, it should be migrated as below:
|
|
select substr('!2d3d4dd!',1,5);
|
|
|
|
If false, it should be retained as it is:
|
|
select dbms_lob.substr('!2d3d4dd!',5);</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>
|
|
|