Re: Carriage return in a VARCHAR in PL/SQL

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1998/03/31
Message-ID: <3523263e.3858077_at_192.86.155.100>#1/1


A copy of this was sent to Spirit <Christophe.Calandreau_at_eleve.emn.fr> (if that email address didn't require changing) On Tue, 31 Mar 1998 18:51:27 +0200, you wrote:

>Hi,
>
>I'm currently working on a project using Oracle 8 and more precisely
>PL/SQL under SQL* PLUS.
>
>Unfortunately, I'm stuck with an very annoying problem. I want put some
>query output (after some changes like explanations or commentaries) in
>a VARCHAR variable in a pretty style so that the result will be clear to
>the user. This VARCHAR will be sent by e-mail to the user at the end of
>the program.
>
>In consequence, I'm searching since few days how to insert a carriage
>return in a VARCHAR.
>It's possible in ASCII, it must be possible in PL/SQL, mustn't it?
>If you know how to do that or if it's impossible, please reply quickly.
>
>Any hint will be highly appreciated.
>
>Christophe

chr(10) will do it.

Also, if you just open a constant on one line and let it wrap from line to line, the linefeeds stay in there. For example:

SQL> begin
  2 dbms_output.put_line( 'Hello
  3 there
  4 how are you?
  5 these are line breaks' );
  6 end;
  7 /
Hello
there
how are you?
these are line breaks

So, if the constant spans lines, the linefeeds stay....  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue Mar 31 1998 - 00:00:00 CEST

Original text of this message