Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Searching for newline characters in a varchar
>Subject: Re: Searching for newline characters in a varchar
>From: GreMa_at_t-online.de (Matthias Gresz)
>Date: Tue, Oct 14, 1997 07:32 EDT
>Message-id: <61vl8s$8hu$1_at_news02.btx.dtag.de>
>
>Bryan J. Gentile wrote:
>>
>> I want to find out how I can search through a variable of type varchar
>> and replace newline characters with something else. (PL/SQL)
>>
>> --
>> **************************************
>> Bryan J. Gentile
>> Consultant
>> Business Data Services, Inc.
>> Glastonbury, CT 06033
>> Phone: (860) 633-3693 (ext. 3006)
>> Vmail: (ext. 6030)
>> **************************************
>Hi,
>
>try
>
>SUBSTR(string,1,INSTR(string,chr(13))-1) || newchar
>||SUBSTR(string,INSTR(string,chr(13)) + 1,length(string))
>
>--
>Regards
>
>M.Gresz :-)
Well you could do that, but it will only find the first instance.
Try
my_string := replace(my_string,chr(13),null)
Note that the newline character is operating system specific. Substitute for chr(13) as necessary
Example
my_string := replace(my_string,chr(10),null);
John
FOR UTILITY PARTNERS EMPLOYMENT
OPPORTUNITIES VISIT www.utilpart.com
e-mail: jomarlen_at_aol.com
Web Site: http://members.aol.com/jomarlen/
The views expressed in this message
are those of the author and not
necessarily those of U.P. Inc.
and/or its employees.