CREATE OR REPLACE function HDMS.stripperc(string_in in CLOB, repl in varchar2 DEFAULT NULL) return CLOB /* this function will strip out html tags from a VARCHAR2 string. It takes two arguments. One is the string or the column to be stripped. The other is a string that you can specify to use to replace the stripped out tags. This argument is optional. If you don't supply this argument, the tag will be stripped out and replaced with nothing. Depending on what version of Oracle you are running, this function may or may not work with VARCHAR2 fields. Try it anyway. If it doesn't work, then use function stripper, which will do the same thing for VARCHAR2s. C. Fogelsong 09/18/2008 */ IS htag CLOB; hslashtag CLOB; startpos NUMBER; endpos NUMBER; string_out CLOB; BEGIN startpos:= INSTR(string_in, '<'); endpos:= INSTR(string_in, '>')+1; IF startpos = 0 OR endpos = 1 OR startpos > endpos THEN RETURN(string_in); END IF; string_out:= string_in; WHILE startpos <> 0 AND endpos <> 1 AND startpos < endpos LOOP htag:= SUBSTR(string_out, startpos, (endpos - startpos)); string_out:= REPLACE(string_out, htag, repl); hslashtag:= SUBSTR(htag, 1, 1)||'/'||SUBSTR(htag,2); string_out:= REPLACE(string_out, hslashtag, repl); startpos:= INSTR(string_out, '<'); endpos:= INSTR(string_out, '>')+1; END LOOP; RETURN(string_out); END; /