DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: How can I set serveroutput on in a stored procedure?

  1. #1
    Join Date
    Aug 2000
    Posts
    462
    How can I set serveroutput on in a stored procedure? When I try it, I get:

    PLS-00103: Encountered the symbol "SERVEROUTPUT" when expecting
    one of the following:
    transaction
    Oracle DBA and Developer

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    dbms_output.enable (1000000);
    Jeff Hunter

  3. #3
    Join Date
    Aug 2000
    Posts
    462
    Is there any reason this wouldn't work in Personal Oracle. I'm messing around with it here at home, and it doesn't work.

    SQL>exec dbms_output.enable(100000);
    PL/SQL procedure successfully completed.

    SQL>exec dbms_output.put_line('Hi there!');
    PL/SQL procedure successfully completed.

    SQL>set serveroutput on

    SQL>exec dbms_output.put_line('Hi there!');
    Hi there!
    Hi there!

    It seems that the output was buffered, but it wasn't flushed until I set serveroutput on.

    Now what?
    Oracle DBA and Developer

  4. #4
    Join Date
    Sep 2000
    Location
    Sao Paulo,SP,Brazil, Earth, Milky Way
    Posts
    350
    It´s NOT a personal Oracle issue here, but a general one. The ENABLE procedure turn the BUFFER on, but sql*plus can´t "see" it´s on by itself, the setting needed to do it is the SET serveroutput on.
    Note : ANY setting in sql*plus environment (linesize, screen echo, page size in screen, etc) MUST be done using a sql*plus command called SET (or using the menu, in GUI mode), and PL/SQL don´t understand sql*plus commands (SET or whatever - PL/SQL just "knows" PL and SQL commands). SO, the environment must be ready BEFORE the PL/SQL runs : you can do it in a PL/SQL script BEFORE the PL/SQL block, OR automagically habilit put the sql*plus commands in the login/glogin script.

    Regards,

    Chiappa



  5. #5
    Join Date
    Aug 2000
    Posts
    462
    That's what I had come up with, and I was afraid that was the answer. I don't know that we want to set serveroutput on in glogin, and I wanted to handle it for the user. I suppose I'll use a script.

    Thanks everyone!

    Oracle DBA and Developer

  6. #6
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    You have 'users' using SQL*PLUS????

    - Chris

  7. #7
    Join Date
    Aug 2000
    Posts
    462
    Not usually. In this case, application developers on a development environment . . .
    Oracle DBA and Developer

Posting Permissions

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


Click Here to Expand Forum to Full Width