0% found this document useful (0 votes)
118 views2 pages

Setting SERVEROUTPUT in Oracle: DBMS - OUTPUT. With Set Serveroutput On, This Behavior Is Changed

By default, SQL*PLUS does not display output from PL/SQL programs written with DBMS_OUTPUT.PUT_LINE. Setting SERVEROUTPUT to ON allows this output to be viewed. The SIZE parameter sets the maximum number of bytes that can be buffered for output, and can be set to UNLIMITED. FORMAT controls how output is formatted to fit the line size.

Uploaded by

naga
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views2 pages

Setting SERVEROUTPUT in Oracle: DBMS - OUTPUT. With Set Serveroutput On, This Behavior Is Changed

By default, SQL*PLUS does not display output from PL/SQL programs written with DBMS_OUTPUT.PUT_LINE. Setting SERVEROUTPUT to ON allows this output to be viewed. The SIZE parameter sets the maximum number of bytes that can be buffered for output, and can be set to UNLIMITED. FORMAT controls how output is formatted to fit the line size.

Uploaded by

naga
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Setting SERVEROUTPUT in Oracle

By default, SQL*PLUS doesn't read what a PL/SQL program has written with DBMS_OUTPUT. With set serveroutput on, this behavior is changed.

Note: The size unlimited clause comes with Oracle 10g Release 2.
OFF suppresses the output of DBMS_OUTPUT.PUT_LINE. ON displays the output. ON uses the SIZE and FORMAT of the previous SET SERVEROUTPUT ON SIZE n FORMAT f, or uses default values if no SET SERVEROUTPUT command was previously issued in the current connection. SIZE sets the number of bytes of the output that can be buffered within the Oracle Database server. The default is UNLIMITED. n cannot be less than 2000 or greater than 1,000,000. In iSQL*Plus you can enter the word UNLIMITED in the Size field.

Resources are not pre-allocated when SERVEROUTPUT is set. As there is no performance penalty, use UNLIMITED unless you want to conserve physical memory.

Every server output line begins on a new output line.

When WRAPPED is enabled SQL*Plus wraps the server output within the line size specified by SET LINESIZE, beginning new lines when required.

When WORD_WRAPPED is enabled, each line of server output is wrapped within the line size specified by SET LINESIZE. Lines are broken on word boundaries. SQL*Plus left justifies each line, skipping all leading whitespace. When TRUNCATED is enabled, each line of server output is truncated to the line size specified by SET LINESIZE.

Example:
SQL> SHOW SERVEROUTPUT; SQL> SET SERVEROUTPUT ON; SQL> SET SERVEROUTPUT OFF; SQL> SET SERVEROUTPUT ON SIZE 4000; SQL> SET SERVEROUTPUT ON SIZE UNLIMITED; SQL> SET SERVEROUTPUT ON FORMAT WRAPPED; SQL> SET SERVEROUTPUT ON FORMAT WORD_WRAPPED; SQL> SET SERVEROUTPUT ON FORMAT TRUNCATED;

You might also like