I learned just last week that the sql-window has some form of bindvariables. But they should be prefixed with '&'.
Is the suggestion of Scott not be solved with the following enhancements?
1. Create a preference to be able to define the bind-variable-character (so that you can change ampersant in colon)
2. Handle bind-variables in SQL-window the same as in Test window, since in SQL-window they are asked for in a pop-up so you can't review the contents during execution.
3. Create a pop-up menu-option 'Execute as SQL' or something to execute selected code or the code where the cursor is in. So that you can point a cursor definition or a sql-statement and that the sql is extracted as is to a new sql-window. It would be nice that in case of a cursor definition that the cursor-parameters are transformed into bind-variables, so that you can fill-in test values for it.
I would love to have this enhancement, since I'm also regularly extract seperate sqls from cursors during debugging. It would also be nice to have a button that when debugging a cursor that a separate sql-window would be created with the exact sql and the exact bind-variables filled in so that the result from the cursor could be reviewed before it is executed within the debugger. Because often that is actually what I'm trying to do when I'm debugging: check if my sql's are executed with the right conditions, right variables and give the result I expect.
Regards,
Martien