Ref. SR 4798837 "Executing (F5) ignores the "Substitution Variable Prompting" configuration"
After some back and forth with support, I have been advised to use F9 instead of F5 in order for Toad not to prompt for ampersand variables, even though these variables were commented out in the code.
I believe the settings window should state right off the bat that the options for "Substitution Variable Prompting" only apply to F9. Otherwise this is misleading and leads to thinking it is a bug.
Also it is not clear at this point :
- what the differences are between F5 and F9, other than the above difference
- why Toad tries to substitute variables in comments
If you are running a single sql statement, it is almost always preferable to use F9.
The purpose of F5 is to mimic SQL*Plus. F5 is good for for running multiple statements as a script. As a bonus, it can put SELECT results in a grid, but that comes at a price. All records are fetched immediately, and as strings, unless you cancel.
F9 will fetch a block of rows, with native datatypes. If you want more rows, you can scroll down. F9 also uses less memory and is faster. If you include ROWID in your selects, then you can edit data in the grid. This is not possible with F5.
If you want to disable sub variables for comments, right-click in the Editor. Choose "Substitution Variable Prompting", and then "Ignore those in comments".
Hi John! I'm not get a behavior change based on your recommendation to change the setting to ignore those in comments. I tried both the single line --testing & Sign comment as well as /* testing & Sign*/. I continue to get prompted for input. I've even tried the "None" option with no change in behavior.
Yes, F9 is a option, but there are many times I'm deploying many objects in a script and have to come up with a work around.
Can we get the Ignore in comments feature improved or working in our case?
Hi Chad,
We try to mimic SQL*Plus behavior as much as possible with script execution.
You can use SET DEFINE OFF at the top of your script to disable substitution variable prompting completely. If you have some variables that you want to be prompted for, which are outside of comments and strings, I think your best bet would be to put them at the beginning, then SET DEFINE OFF after them.
-John
OK, so the setting of ignore in comments are more for the F9 single statement execution?
That's correct. I'll update the options window so that it states this, as OP requested.
See also this post for more details on differences between F5 and F9.
1 Like