Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Does CHR(10) add an extra newline?
On Nov 21, 7:40 pm, "fitzjarr..._at_cox.net" <fitzjarr..._at_cox.net> wrote:
> On Nov 21, 12:48 pm, Frank van Bortel <frank.van.bor..._at_gmail.com>
> wrote:
>
> > Brian Tkatch wrote:
> > > While writing a query to do some editting i wanted to use CHR(10) to
> > > have a query do some formatting. It seems that whenever it is used, it
> > > adds an extra newline at the end of the line.
>
> > > SQL> SELECT RowNum A, CHR(10) || RowNum B FROM (SELECT * FROM Dual
> > > CONNECT BY LEVEL < 4)
>
> > No - your display simply is not wide enough.
> > Why don't you check out all possible settings in SQL*Plus?
> > the one you want is SET LINES[ize]
>
> > --
> > Regards,
> > Frank van Bortel
>
> I return the same results that you posted, using 10.2.0.3.0 on AIX:
>
> SQL> SELECT RowNum A, CHR(10) || RowNum B FROM (SELECT * FROM Dual
> 2 CONNECT BY LEVEL < 4);
>
> A B
> -- -----------------------------------------
> 1
> 1
>
> 2
> 2
>
> 3
> 3
>
> no matter how long my linesize. Also the method of introducing the
> chr(10) into the text matters not:
>
> SQL> variable lf varchar2
> SQL> exec :lf := chr(10);
>
> PL/SQL procedure successfully completed.
>
> SQL> select rownum a, :lf||rownum b
> 2 from dual
> 3 connect by level < 4;
>
> A B
> --
> ------------------------------------------------------------------------
> 1
> 1
>
> 2
> 2
>
> 3
> 3
>
> SQL>
>
> I find no explanation of this behaviour on the web, thus I am at a
> loss to explain it.
>
SET RECSEP OFF
The default setting is WRAP.
<http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/
ch12040.htm#SQPUG097>
Or use a client other than SQL*Plus. Received on Fri Nov 23 2007 - 01:36:29 CST
![]() |
![]() |