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

Home -> Community -> Usenet -> c.d.o.server -> Re: Space in the output

Re: Space in the output

From: Jurij Modic <jmodic_at_src.si>
Date: Tue, 26 Oct 1999 20:15:17 GMT
Message-ID: <38180797.6614782@news.siol.net>


On Tue, 26 Oct 1999 16:53:24 +0200, Erika Grondzakova <Erika.Grondzakova_at_cern.ch> wrote:

>Hello,
>
>Is it possible to force somehow Oracle in SQL*Plus to get output of the
>DBMS_OUTPUT.PUT_LINE command with the leading spaces?
>
>Following example will print the word hello from the beginning from the
>line:
>
>SQL> begin
> 2 dbms_output.put_line(' hello');
> 3 end;
> 4 /
>hello
>
>And I would like to display it with the leading spaces :
> hello

In SQL*Plus you must use FORMAT WRAPPED to preserve leading spaces in DBMS_OUTPUT. Here is a cut&paste example from SQL*Plus:

SCOTT_at_PO73> SET SERVEROUTPUT ON FORMAT
Usage: SET SERVEROUTPUT { ON | OFF } [SIZE n]

             [ FOR[MAT] { WRA[PPED] | WOR[D_WRAPPED] | TRU[NCATED] } ]

SCOTT_at_PO73>
SCOTT_at_PO73> SET SERVEROUTPUT ON FORMAT WRAPPED
SCOTT_at_PO73>
SCOTT_at_PO73> begin

  2 dbms_output.put_line('...hello');   3 dbms_output.put_line(' hello');   4 end;
  5 /
...hello

   hello

PL/SQL procedure successfully completed.

>Actually I need it in the file where I'm spooling the output.
>
>Thank you in advance,
>
>Erika

HTH, Jurij Modic <jmodic_at_src.si>
Certified Oracle DBA (7.3 & 8.0 OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Tue Oct 26 1999 - 15:15:17 CDT

Original text of this message

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