Extract particular line from CLOB - ORACLE -
i have field in oracle database of type clob. extract first line alone clob filed. here's example of content:
"<div class="pi-tier3"><div class="pi-pdpmainbody"><p><b>fit</b></p><p>core indy - compression </p> <p><b>pro</b></p><ul> <li>abcdef:pmid12345rmln1vlid0</li> <li>abcdef:pmid12345rmln1vlid0</li> <li>abcdef:pmid12345rmln1vlid0</li> <li></li> <li>abcdef:pmid12345rmln1vlid0</li> </ul> <p><b>prp</b></p><ul> <li>100%</li> <li>dry</li> </ul> <p>abcdef:pmid12345rmln1vlid0</p> </div></div>"
the result should this:
"<div class="pi-tier3"><div class="pi-pdpmainbody"><p><b>fit</b></p><p>core indy - compression </p>
if want return characters beginning of clob value characters before first newline (chr 10), here example:
create table tab1 (c1 clob); insert tab1 values ('line 1' || chr(10) || 'line 2'); select dbms_lob.substr(c1, dbms_lob.instr(c1, chr(10))-1, 1) tab1; dbms_lob.substr(c1,dbms_lob.instr(c1,chr(10))-1,1) ------------------------------------------------------------------------------ line 1
check this out more information.
Comments
Post a Comment