variable vs set serveroutput on [message #429550] |
Wed, 04 November 2009 08:41 |
pointers
Messages: 451 Registered: May 2008
|
Senior Member |
|
|
Hi,
I have a script file like
set serveroutput on
variable aa number;
begin
:aa=100;
dbms_output.put_line('1 here we go ahah'||:aa);
end;
/
connect gapc/s0lut_1on@apchcp1_cihcispdb019
--set serveroutput on
begin
dbms_output.put_line('2 here we go ahah'||:aa);
end;
/
I am running the above script from a batch file which directly connect to the db 'abcd' then from the script i am connecting to other db let say 'jklm'.
I am able to persist the value of "aa" for the first db and second db as well.
But the observed thing is 'set serveroutput on'
if i enable 'set serveroutput on' for the first time then that is not reflecting for the second db connection. I need to explicitly write 'set serveroutput on' for the second connection also. Otherwise it is not printing.
what could be the reason by comparing the two cases.
one more thing, when i connect to new db from the script am i connecting to the new session. little confused..
Please help me
Regards
Pointers
|
|
|
Re: variable vs set serveroutput on [message #429551 is a reply to message #429550] |
Wed, 04 November 2009 08:45 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Of course, when you connect to the second server, how do you expect the second server to know whether you told the first server to switch his output on or off?
And of course when you connect to a new server, you get a new session.
|
|
|
|
|