FUNCTION phoneCleanUp (p_phoneNumber IN VARCHAR2) RETURN VARCHAR2 IS --=========================================================================== -- Copywright 2003, www.oracletricks.com by joel crainshaw and chet west --=========================================================================== -- DESCRIPTION -- returns a cleaned up "phone number" -- --=========================================================================== -- MODIFICATION HISTORY -- Person Date Comments -- --------- ---------- ------------------------------------------- -- chet 10/08/2003 Initial Version --=========================================================================== v_cleanPhone VARCHAR2(2000); BEGIN -- -- Set or working variable -- v_cleanPhone := ' '||p_phoneNumber||' '; -- -- Make it all upper case -- v_cleanPhone := UPPER(v_cleanPhone); -- -- Get rid of multi-spaces -- v_cleanPhone := singleSpace(v_cleanPhone); -- -- Get rid of symbols -- v_cleanPhone := noSymbols(v_cleanPhone, LENGTH(v_cleanPhone)); -- -- Get rid of characters -- v_cleanPhone := phoneWords(v_cleanPhone); -- -- Get rid of ALL spaces -- v_cleanPhone := REPLACE(v_cleanPhone,' ',''); -- RETURN v_cleanPhone; END phoneCleanUp; --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--== --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--== --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==