Re: DBMS_OUTPUT and LPAD

From: L120bj <l120bj_at_aol.com>
Date: 1997/02/23
Message-ID: <19970223113000.GAA04607_at_ladder02.news.aol.com>#1/1


I had a similar problem recently and it turned out that it wasn't a problem, if you see what I mean.
If you spool the output to a file you get exactly what you expect, it is only the output to the screen which it trimming of the leading spaces - don't ask me why !




Subject: DBMS_OUTPUT and LPAD
From: "David E. Daniel" <david.daniel_at_wmich.edu> Date: Fri, 21 Feb 1997 21:29:44 -0500
Message-ID: <330E5A18.3B1E_at_wmich.edu>

Greetings,

I am having a little difficulty with the DBMS_OUTPUT in PL/SQL. I am trying to format a report and I am having trouble adding leading blank spaces. I am using the following command:

padded_str := ' '; /* This is declared a varchar2(20) */ DBMS_OUTPUT.PUT_LINE
(LPAD(padded_str,2*(lev1 -1))||d2.file_id||' --- '||d2.file_title);

The output looks like the following:

9051034-10 *** some title (irr)
9023045-23 *** another title

What it should look like

9051034-10 *** some title (irr)
  9023045-23 *** another title

The report is to generate a family tree. If I use the foloowing as my padded_str, I get the desired results, but it leaves a period at the beginning of each line.
padded_str:= '. ';

Any help with this would save what little hair I have left.

Also, could someone please let me know how to perform a line feed
(blank line) when using the DBMS_OUTPUT package?

Regards,

David E. Daniel
david.daniel_at_wmich.edu

-- 
David E. Daniel			
Oracle Database Administrator	
University Computing Services
Western Michigan University
Received on Sun Feb 23 1997 - 00:00:00 CET

Original text of this message