LLI Wiki — My Digital Knowledge Base

Oracle: DBMS_OUTPUT.PUT_LINE prints nothing in SQL*Plus

Enable SET SERVEROUTPUT ON to display DBMS_OUTPUT in SQL*Plus.

In SQL*Plus, DBMS_OUTPUT.PUT_LINE prints nothing until server output is enabled with SET SERVEROUTPUT ON.

Example

exec dbms_output.enable(10000);

PL/SQL procedure successfully completed.

exec dbms_output.put_line( 'x' );

PL/SQL procedure successfully completed.

set serveroutput on

exec dbms_output.put_line( 'x' );
x

PL/SQL procedure successfully completed.

The first put_line prints nothing because serveroutput is off. After set serveroutput on, the text is displayed.

Set a buffer size

set serveroutput on size 30000;
exec my_procedure('value');
Mastodon LLIMastodon SocialFosstodon