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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Find line breaks on different systems

Re: Find line breaks on different systems

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: Fri, 01 Aug 2003 14:12:07 +0000
Message-ID: <3175063.1059747127@dbforums.com>

Originally posted by Bernhard Graeuler
> Hi,
>
> I have to split a string that contains line breaks into multiple
> strings.
> The problem is, that I don't know which linebreaks oracle uses. Is
> it always
> 'CR' or does it depend on the system (AFAIK Windows uses 'CRLF',
> MAC uses
> 'LF', UNIX uses 'CR').
>
> Do I have to check all possibilities in my stored procedure or
> is there
> another way to do this.
>
> I test the procedure by running a script file with the '@' command of
> sqlplus. In this file I use something like
>
> begin
> PACKAGE.SPLITLINE('This is
> a multiple
> line
> line.');
> end;
> /
>
> Confusing: Im using Windows, so I expected 'CRLF' as line break, but
> SPLITLINE only works correctly if it searches for 'CR'.
>
> Regards
>
> Bernhard

To be safe and OS independent, check separately for both.

IF ( (INSTR(string, CHR(13), 1, 1) != 0) OR

      (INSTR(string, CHR(10), 1, 1) != 0) ) THEN     .....
END IF Regards
/Rauf Sarwar

--
Posted via http://dbforums.com
Received on Fri Aug 01 2003 - 09:12:07 CDT

Original text of this message

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