Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Removing Tabs From Strings With PL/SQL
In article <3a75ec30.68117227_at_news-server>,
gteets_at_rr.cinci.com (Greg Teets) wrote:
> I have a column of text. Some of the strings in
> the table have tabs in them. I have been working
> with LTRIM in PL/SQL to remove the tabs but cannot get it
> to work.
>
> I assume I would set the second parameter to a
> tab, presumably using the ASCII code for tab.
>
> If someone has done this, please let me know how
> to do it. I am working on Windows NT.
>
> Thank you.
>
> Greg Teets
> Cincinnati, OH
>
Instead of using left trim, ltrim, why not use replace to replace tab
characters with null, which will in effect concatenate the before and
after tab character fields together. Example code:
UT1> l
1 declare
2 v_out varchar2(30) := NULL;
3 begin
4 v_out := 'Test'||chr(9)||'String';
5 dbms_output.put_line(v_out);
6 v_out := replace(v_out,chr(9),'');
7 dbms_output.put_line(v_out);
8* end;
UT1> /
Test String
TestString
PL/SQL procedure successfully completed.
-- Mark D. Powell -- The only advice that counts is the advice that you follow so follow your own advice -- Sent via Deja.com http://www.deja.com/Received on Tue Jan 30 2001 - 09:18:32 CST
![]() |
![]() |