Home » SQL & PL/SQL » SQL & PL/SQL » How to set serveroutput thorogh stored procedure
How to set serveroutput thorogh stored procedure [message #40702] Fri, 01 November 2002 01:19 Go to next message
Sameer
Messages: 60
Registered: March 1998
Member
Can I set serveroutput on through a stored procedure?

I used 'execute immediate alter system set serveroutput on' to do the same but it gives error AT runtime..

does someone know the answer...??
Re: How to set serveroutput thorogh stored procedure [message #40706 is a reply to message #40702] Fri, 01 November 2002 05:42 Go to previous messageGo to next message
Rick Cale
Messages: 111
Registered: February 2002
Senior Member
I think you can only set serveroutput at the sqlplus prompt or interactively in worksheet. This is a interactive command. There is no alter system command for this.
Re: How to set serveroutput thorogh stored procedure [message #40708 is a reply to message #40702] Fri, 01 November 2002 10:10 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
When you do a "set serveroutput on" from sqlplus, it does two things:
1.) enables dbms_output buffer
2.) tells sqlpus to display the contents of buffer

You can set the size of the output buffer from pl/sql using:
begin
-- 1000000 is max
dbms_output.enable(1000000);
end;
You then need to fetch the output yourself using dbms_output.get_line.

You can also set the size using "set serveroutput on size 1000000"
Re: How to set serveroutput thorogh stored procedure [message #40734 is a reply to message #40702] Mon, 04 November 2002 08:00 Go to previous message
waris
Messages: 115
Registered: November 2001
Senior Member
Hi Sameer,

no yaar u cant set serveroutput on thru or in a pl/sql procedure its an sql * plus command alternatively u can write a small sql script suc as fallows in a .sql file

set serveroutput on size 10000
execute procedure_name;
Previous Topic: set PCTFREE and PCTUSED
Next Topic: Top-N SQL question
Goto Forum:
  


Current Time: Sun Apr 28 06:06:55 CDT 2024