Toad Automation Designer - Export Dataset Bug

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;
/

Sorry for the dumb question, but you don't have a "disconnect" command anywhere in your script, do you? That could cause package variable values to be forgotten too.

Looking at the source, I can't think of any other possible causes for this.

Try turning on spool sql and looking at the output for clues.