Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Space in the output
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
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)