0

I have problem with dbms_output in Toad, it ignores spaces, and lpad and rpad functions. When I execute this procedure:

create or replace procedure example
as
    w clob;
    l_line varchar2 (244):='   ';
    l_line_2 varchar2 (244):='   ';
begin
    dbms_lob.createtemporary(w, true);

    for k in 1..10 loop
        l_line := l_line || (lpad (k,5,' '));
        l_line_2:= l_line_2 || (lpad ('-',5,' '));
    end loop;

    dbms_lob.append(w, l_line|| chr(10)); 
    dbms_lob.append(w, l_line_2|| chr(10)); 
    dbms_output.put_line (w); 
end example;

In SQL Developer I get this result:

   1    2    3    4    5    6    7    8    9   10
   -    -    -    -    -    -    -    -    -    -

But in Toad I get this result:

        1  2  3  4  5  6  7  8  9  10
        - - - - - - - - - -

I have tried changing Toad options but result stay the same. What I have to do in Toad to have the same result as in SQL Developer?

William Robertson
  • 15,273
  • 4
  • 38
  • 44
Tom
  • 43
  • 9
  • SET SERVEROUTPUT ON FORMAT WRAPPED or SET SERVEROUTPUT ON FORMAT TRUNCATED. Taken from here: https://stackoverflow.com/questions/2584492/how-to-prevent-dbms-output-put-line-from-trimming-leading-whitespace – g00dy Sep 20 '17 at 12:19
  • Can you configure the font for the output in TOAD? Choose a fixed width font like "Courier New" or "Consolas" –  Sep 20 '17 at 12:19
  • Thanks I changed font to fixed font, now it shows results like in SQL developer. – Tom Sep 20 '17 at 12:25

0 Answers0