Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2002
    Posts
    58

    Unanswered: SQL-Programmer and SERVEROUTPUT

    Why do I get an error (PLS-00103) when I put "SET SERVEROUTPUT ON" in my procedure using SQL-Programmer? anyone else have this problem?

    I need to display output with dbms_output.put_line so setting it on seems to be the only way.

    Thanks

  2. #2
    Join Date
    May 2003
    Posts
    87

    Re: SQL-Programmer and SERVEROUTPUT

    SET SERVEROUTPUT ON is a SQL*Plus command. You have to set this ON in your SQL*Plus session so that the messages are dumped to the screen. You will have to use dbms_output.put_line stmts in your PL/SQL block or procedure or function to display the messages.

    Code:
    SQL> set serveroutput on
    SQL> 
    SQL> begin
      2    dbms_output.put_line('Hi ...');
      3  end;
      4  /
    Hi ...
    
    PL/SQL procedure successfully completed.
    
    SQL>
    Hope this helps !!

    Originally posted by WhiZa
    Why do I get an error (PLS-00103) when I put "SET SERVEROUTPUT ON" in my procedure using SQL-Programmer? anyone else have this problem?

    I need to display output with dbms_output.put_line so setting it on seems to be the only way.

    Thanks

  3. #3
    Join Date
    Feb 2002
    Posts
    58
    Thanks for the help

    SET SERVEROUTPUT ON is just a SQL Plus command, so I was able to run the proc from SQL PLus and get the correct results.

  4. #4
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482

    Thumbs up

    If you want your stored procedures/fucntions to return output info outside SQL*PLus - then use UTL_FILE package to write the messages to OS file. This way you can get debug information during run time (you don't have to wait the procedure to complete as with DBMS_OUTPUT).

    If you have *NIX based OS - $ tail -f filename , will display you the messages in a real time.


    Hope that helps,

    clio_usa - OCP - DBA

    dbaclick.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •