|Oracle8i Supplied PL/SQL Packages Reference
Release 2 (8.1.6)
Part Number A76936-01
DBMS_OUTPUT package enables you to send messages from stored procedures, packages, and triggers.
PUT_LINE procedures in this package enable you to place information in a buffer that can be read by another trigger, procedure, or package. In a separate PL/SQL procedure or anonymous block, you can display the buffered information by calling the
If you do not call
GET_LINE, or if you do not display the messages on your screen in SQL*Plus or Enterprise Manager, then the buffered messages are ignored. The
DBMS_OUTPUT package is especially useful for displaying PL/SQL debugging information.
At the end of this script, a public synonym (
DBMS_OUTPUT) is created and
EXECUTE permission on this package is granted to public.
DBMS_OUTPUT subprograms raise the application error
ORA-20000, and the output procedures can return the following errors:
Line length overflow
CHARARR is a table type.
A trigger might want to print out some debugging information. To do this, the trigger would do:
If you have enabled the
DBMS_OUTPUT package, then this
PUT_LINE would be buffered, and you could, after executing the statement (presumably some
UPDATE that caused the trigger to fire), get the line of information back. For example:
It could then display the buffer on the screen. You repeat calls to
GET_LINE until status comes back as non-zero. For better performance, you should use calls to
GET_LINES which can return an array of lines.
Enterprise Manager and SQL*Plus implement a
ON command to know whether to make calls to
S) after issuing
DELETE or anonymous PL/SQL calls (these are the only ones that can cause triggers or stored procedures to be executed).