Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Usage dbms_output.enable

Re: Usage dbms_output.enable

From: <Solomon.Yakobson_at_entex.com>
Date: 1997/03/04
Message-ID: <857517165.10583@dejanews.com>#1/1

DBMS_OUTPUT.PUT_LINE simply writes text to a buffer. DBMS_OUTPUT.ENABLE simply sets buffer size. SQL*Plus command SET SERVEROUTPUT ON SIZE(n) does the same thing as DBMS_OUTPUT.ENABLE plus it retrieves and displays all that text DBMS_OUTPUT.PUT_LINE wrote into DBMS_OUTPUT buffer. You can retrieve it in PL/SQL by using DBMS_OUTPUT.GET_LINE, but there is no way to display it from within PL/SQL. It has to be done by the environment that calls your stored procedure. And in SQL*Plus it is SET SERVEROUTPUT ON.

Solomon.Yakobson_at_entex.com

In article <331C5EC9.2214_at_ornl.gov>,
  John Hough <q6y_at_ornl.gov> wrote:
>
> To all:
>
> I am attempting to write a pl/sql procedure that utilizes
> the dbms_output.put_line package. In the past I have
> utilized this for debugging and simply typed
> "set serveroutput on size 100000"
> before executing the procedure and the results were
> displayed to the screen. My current project leader does
> not want the persons exeucting the stored procedure to
> have to turn serveroutput on in order to see the put_line
> results. So I am trying to get the procedure to do the
> same utilizing the dbms_output.enable call, so far no
> luck. I have placed a snippet of the code below,
> where should the call to dbms_output.enable be to have
> the buffer go to the screen. Do any other calls need to
> be made. I tried to place it as the first line of code
> with a disable at all exit points but it did not work.
>
> Help???, and thanks
>
> John Hough
>
> BEGIN
>
> OPEN c_locks_held;
>
> FETCH c_locks_held into v_osuser;
>
> WHILE c_locks_held%FOUND LOOP
> dbms_output.put_line(rpad(v_osuser,10,' '));
> FETCH c_locks_held into v_osuser;
> END LOOP;
>
> CLOSE C_LOCKS_HELD;
>
> END;

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Tue Mar 04 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US