I just added a script action which sets a package variable. I definitely see the package variable as default with "Execute scripts in Toad session" unchecked, and whatever I set it to retained when I check that option.
I added this
And added a function which returns its value here:
The output is as expected -- 99 when "Execute scripts in Toad session" is checked, default otherwise
My "package_with_state" package is as follows:
CREATE OR REPLACE PACKAGE package_with_state AS
global_variable NUMBER := 2;
function global_var return number;
END package_with_state;
/
CREATE OR REPLACE PACKAGE body package_with_state AS
function global_var return number as
begin
return global_variable;
end;
END package_with_state;
/

