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

Home -> Community -> Usenet -> c.d.o.server -> PL/SQL : serveroutput on inside begin..end block Possible ? Impossible??

PL/SQL : serveroutput on inside begin..end block Possible ? Impossible??

From: baka <mesundara_at_hotmail.com>
Date: 5 Jul 2005 23:47:50 -0700
Message-ID: <1120632470.390863.80300@g43g2000cwa.googlegroups.com>


Dear all

I would like to implement the following functionality inside the PL/SQL block. but it is not working.

--Sample image of my problem
-- implementing the serveroutput on inside pl/sql SQL> create or replace procedure stest as   2

  3       t_bstr1 varchar2(100) := 'ignoreme\namehere';
  4       t_astr1 varchar2(100);

  5 begin
  6
  7 execute immediate 'ALTER SYSTEM SET SERVEROUTPUT ON SIZE 500K';
  8        t_astr1 := upper(substr(t_bstr1,
  9                             instr(t_bstr1, '\') + 1));
 10       DBMS_OUTPUT.PUT_LINE('String Before breaking'|| t_bstr1);
 11       DBMS_OUTPUT.PUT_LINE('String Before breaking'||t_astr1);
          execute immediate 'ALTER SYSTEM SET SERVEROUTPUT OFF';
 12 end;
 13 /

Procedure executed.

SQL> exec stest;
BEGIN stest; END;

*
Error in Line 1:

ORA-02065: ALTER SYSTEM -Option ignored??.
ORA-06512: "test.STEST",Line7
ORA-06512: Line1

SQL>
 (Above message translated from Japanese.)

What is the alternate way of writing Line 7:

I am well aware of Serveroutput on can be set on using the glogin.sql and login.sql.
but i do not want to disturb the environment file/s. So, i want implement inside the procedure itself

Thanks in Advance Received on Wed Jul 06 2005 - 01:47:50 CDT

Original text of this message

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