CREATE OR REPLACE FUNCTION F_CALLNO(CALLNO IN VARCHAR) RETURN VARCHAR deterministic IS retval VARCHAR(200); i NUMBER; countnum NUMBER; tmp_CALLNO varchar(200); tmp_retval varchar(200); BEGIN countnum := REGEXP_COUNT(CALLNO, '[/:=£º~¡«]')+1; i := 1; while countnum>=i loop if i=1 then tmp_CALLNO := RPAD(REGEXP_SUBSTR(CALLNO ,'[^/:=£º~¡«]+', 1, i),15,'*'); retval := tmp_CALLNO; else tmp_CALLNO := LPAD(REGEXP_SUBSTR(CALLNO ,'[^/:=£º~¡«]+', 1, i),10,'*'); tmp_retval := retval; retval := tmp_retval||tmp_CALLNO; end if; i := i+1; end loop; RETURN retval; END;