I just noticed, thanks to a typo, that variables I created in one js script stay available in SQLcl after execution and can be (in my case accidentally) referenced by subsequent scripts.
If I exit SQLcl and restart it again, it looks like variables are cleared -- is there a way to 'clear' all previous variables etc at the end of a script, or start of the next script, without having to exit and restart?
SQLcl version is 18.1.1, Oracle Server is 11g
My simple test of this is:
create "test_1.js" with single line of:
test_variable = "this is a test";
create "test_2.js" with single line of:
ctx.write(test_variable + "\n");
run the two scripts:
script "test_1.js"
script "test_2.js"
Output should be "this is a test"