It has come up several times before to have a method for executing or otherwise
extracting SQL embedded within PL/SQL. The extracted SQL should convert all
references to PL/SQL identifiers into bind variables. Any INTO clause should be
stripped, etc. The SQL should be syntactically and logically correct to execute
on its own outside of the PL/SQL without error.
I have this done (mostly) internally and it’s just sort of lying there with no
home. How do we surface this? A right-click item to copy it to clipboard or
execute may be appropriate. What about keyboard shortcut for executing? One idea
would be to hijack CTRL+Enter|Shift+F9 so that it operates as it
currently does unless invoked within PL/SQL in which case it could execute the
embedded SQL at caret using the new method. This would mean that CTRL+Enter
could no longer be used to compile PL/SQL or execute anonymous blocks though
unless it was setup to fall back on current behavior if there is no SQL at
caret. Other suggestions?