The Oracle (tm) Users' Co-Operative FAQ
Why do I lose the leading spaces and blank lines when I try to format output through the dbms_output package ?
| Author's name: Jonathan Lewis Author's Email: jonathan@jlcomp.demon.co.uk |
Date written: 28th June 2001 Oracle version(s): 8.1.7.0 |
| The dbms_output package include new_line calls to allow you to print blank lines, but SQL*Plus seems to lose the blank lines. It also loses leasing spaces that you put in to the put_line() call.. |
There is a feature of the set serveroutput on command that was originally undocumented, the format wrapped option. If you issue a command like:
set serveroutput on size 1000000 format wrapped
from SQL*Plus, you will find that your leading spaces and blank lines suddenly reappear, and your output looks a lot tidier. (Note that the limit on the dbms_output buffer is 1,000,000 bytes). As a convenience, you can put this line in your glogin.sql script, or in a local login.sql script.
This feature is automatically enabled in svrmgrl, but Oracle Corp has been telling us for some years that svrmgrl will become defunct - and finally in Oracle 9i this is now true and you actually receive an error message if you try to run it.
Further reading: The FAQ page on using the SQL*Plus glogin.sql script to set this, and other features, automatically.




