williey
Technical User
- Jan 21, 2004
- 242
How do you remove white spaces of a field in stored procedure prior to inserting the record?
Does PL/SQL provide an easy way to do this?
Does PL/SQL provide an easy way to do this?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
create or replace function no_white (str_in varchar2) return varchar2 is
known_white_space_codes varchar2(50)
:= ' ' -- blank space
||chr(9) -- tab
||chr(13) -- carriage return
||chr(10) -- line feed
;
begin
return translate(str_in,'^'||known_white_space_codes,'^');
end;
/
col a heading "Squeezed|Result" format a10
select no_white('Dave '||chr(9)||chr(13)||chr(10)||' Hunt ') a from dual;
Squeezed
Result
--------
DaveHunt