I want to trim spaces between two or more words of a string by single space. for eg:- input string is 'HIGHLAND RD' and output string should be 'HIGHLAND RD'.
i was using REPLACE but it doesn' work as i thought first
v_streetNameAndType :=
REPLACE(LTRIM(p_streetNameAndType),' ',' ');
wondering is there any alternate way to do this.
i am newbie to oracle and haven't used any function.
if i need a function for above , is this close
======================================
FUNCTION SqueezeToOneSpace ( p_instr IN VARCHAR2,
p_outstr OUT VARCHAR2) RETURN VARCHAR2 IS
v_instr VARCHAR2(64);
v_tmpstr VARHCAR2(64);
BEGIN
v_instr:=p_instr;
FOR ' ' IN v_inStr LOOP
v_tmpstr=REPLACE(v_instr,' ',' ');
END LOOP;
p_outstr:=v_tmpstr;
END;
======================
Please help