Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Removing Tabs From Strings With PL/SQL

Re: Removing Tabs From Strings With PL/SQL

From: Steve McDaniels <steve.mcdaniels_at_sierra.com>
Date: Wed, 31 Jan 2001 15:24:19 -0800
Message-ID: <95a6pg$7cn$1@spiney.sierra.com>

consider also using translate
where you can also remove all displayable and/or "bad" characters (LF, for example)

"Mark D Powell" <markp7832_at_my-deja.com> wrote in message news:956lvu$4si$1_at_nnrp1.deja.com...
> 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 Wed Jan 31 2001 - 17:24:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US