René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

dbms_output

enable

In order to use dbms_output, it must be enabled with this procedure. Usually, this is done from SQL*Plus by issuing a set serveroutput on.

Procedures/Functions

disable

procedure disable (
);

enable

procedure enable (
 buffer_size                     in number(38)               default
);

get_line

procedure get_line (
 line                           out varchar2                        ,
 status                         out number(38)                      
);
Get the lines that have been put with put_line.

get_lines

procedure get_lines (
 lines                          out table of varchar2(255)          ,
 numlines                       out number(38)              in/        
);

new_line

procedure new_line (
);

put

procedure put (
 a                               in varchar2                        
);

put_line

procedure put_line (
 a                               in varchar2                        
);

quirks

Maximum of 255 characters per line

dbms_output.put_line has a limitation of 255 characters per line. I find this not very cool and have written a procedure that wraps text so as to fit within those 255 characters.
It seems as though this limitation has been lifted with Oracle 10g Release 2!

Not enabled in SQL*Plus by default

In order to enable dbms_output in sql*plus, use set serveroutput on.

Links

See also my printf.