Outputting leading spaces with serverouput within SQL*PLUS [message #36922] |
Fri, 04 January 2002 02:51 |
Fan Timmermans
Messages: 1 Registered: January 2002
|
Junior Member |
|
|
Hello,
i created a procedure which produces output using DBMS_OUTPUT.PUT_LINE. The output is formatted and sometimes there are leading (left-trailing) spaces.
I'm very surprised to find out that within SQL*Plus these trailing spaces are not present into the spool file. While using TOAD (Quest Software) the DBMS_OUTPUT shows exactly what I created using PUT_LINE.
Has anyone a suggestion?
kind regards
Fan Timmermans
Mediaan/abs bv
the Netherlands.
----------------------------------------------------------------------
|
|
|
|
Re: Outputting leading spaces with serverouput within SQL*PLUS [message #36930 is a reply to message #36922] |
Fri, 04 January 2002 04:49 |
Suresh Vemulapalli
Messages: 624 Registered: August 2000
|
Senior Member |
|
|
use rpad.
look at this example:
declare
cursor c1 is select * from emp;
begin
for i in c1 loop
dbms_output.put_line(rpad(i.empno,10,' ')||rpad(i.ename,30,' ')||rpad(i.sal,10,' '));
end loop;
end;
above example prints with spaces.
Note: remember, parameter to dbms_output.put_line procedure must be less than or equal to 255.
Suresh Vemulapalli
----------------------------------------------------------------------
|
|
|
|