4 Replies Latest reply: Jul 20, 2010 11:48 AM by 785153 RSS

    set serveroutput on;

    785153
      I have 10.2.0.1.0 on Windows XP and have set serveroutput on on sqlplus. However, I don't see the out put from dbms_output.put_line('xxxxxx'); the dbms_output.put_line() is not in IF or ELSE condition.

      Can anyone please shed a light? Thanks in advance.
        • 1. Re: set serveroutput on;
          fjfranken
          Use
          dbms_output.enable();
          first

          HTH,

          FJFranken
          My Blog: http://managingoracle.blogspot.com

          P.S. If this answers your question, please set the thread to answered and award the points. It is appreciated
          • 2. Re: set serveroutput on;
            CKPT
            1. Go to the $ORACLE_HOME/sqlplus/admin folder
            2. Open script "glogin.sql" with the text editor
            3. Add the command 'SET SERVEROUTPUT ON'.
            4. At the end write the CMD that you need to show or the query on the open of the SQLPLUS session.
            • 3. Re: set serveroutput on;
              618702
              Dear 782150,

              Here is a little illustration for you;
              $ sqlplus / as sysdba
              
              SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jul 20 17:25:56 2010
              
              Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
              
              
              Connected to:
              Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
              With the Partitioning, OLAP, Data Mining and Real Application Testing options
              
              SQL> set serveroutput on;
              SQL> exec dbms_output.put_line('ogan');
              ogan
              
              PL/SQL procedure successfully completed.
              
              SQL> set serveroutput off;
              SQL> exec dbms_output.put_line('ogan');
              
              PL/SQL procedure successfully completed.
              
              *SQL> exec dbms_output.enable();*
              
              PL/SQL procedure successfully completed.
              
              *SQL> exec dbms_output.put_line('ogan');*
              
              PL/SQL procedure successfully completed.
              
              *SQL> set serveroutput on;*
              SQL> exec dbms_output.put_line('ogan');
              *ogan*
              *ogan*
              
              PL/SQL procedure successfully completed.
              
              SQL> exec dbms_output.put_line('ogan');
              ogan
              
              PL/SQL procedure successfully completed.
              So it shows two ogan outputs after the dbms_output.enable(). Basically the set serveroutput on should help you but if you can show the SQL you have used it would be better for us to understand the problem.

              Hope That Helps,

              Ogan
              • 4. Re: set serveroutput on;
                785153
                Thank you all, I have resolved the problem.