Toad World® Forums

what happens when you execute code as a script


#1

I have EXECUTE IN THREADS not selected

The following happens with the following code

begin

dbms_session . set_identifier ( ‘xyz’ );

end;

select sys_context( ‘userenv’ , ‘client_identifier’ ) from dual ;

F9 the BEGIN block

Then F9 the select

It shows xyz

But then change the xyz in the BEGIN block to abc

F5 so as to run both as script and you will see abc

But then if you F9 just the select it will show xyz

Can someone explain this. Does it have something to do with a F5 (run as script)
being a separate thread even thoug execute in threads is NOT checked?


#2

Do you have Options->Oracle -> Transactions-> Execute scripts in Toad session
checked?

If not, each script executes in it’s own session.


#3

Thank you. I did not. Now that I have checked the option it works in the Toad
session.

Could we have a HELP button on each Option page that lists the PROS and CONS of
each setting. I am wondering what the downside is of checking the option.
image001.jpeg