| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: stripping html from a clob
I grabbed the code for str_html off asktom which is below:-
function str_html ( line in varchar2 ) return varchar2 is
x varchar2(32767) := null;
in_html boolean := FALSE;
s varchar2(1);
s := substr( line, i, 1 );
if in_html then
if s = '>' then
in_html := FALSE;
end if;
else
if s = '<' then
in_html := TRUE;
end if;
end if;
if not in_html and s != '>' then
x := x || s;
end if;
To change this to work with a clob should be pretty easy (the following code is not tested ... )
function str_html ( line in clob ) return clob is
x clob;
in_html boolean := FALSE;
s varchar2(1);
for i in 1 .. dbms_lob.getlength( line ) loop s := dbms_lob.substr( line, 1, i ); -- dbms_lob substr's last two params
Give that a try and see how it works out. Received on Wed Jul 20 2005 - 15:26:24 CDT
![]() |
![]() |