I'm trying to parameterize the FROM and SELECT clauses in some scripts that I use, and run them from SQL Developer, but getting the output in the worksheet grid to make it easier to read, not on the script output window. A simplified query:
UNDEF FROM
--DEF FROM=DBA_HIST_SQLSTAT
DEF FROM=v$sqlstats
SELECT *
FROM &&FROM
WHERE ROWNUM=1;
I have uncheck the following options:
Database => Object Viewer => Automatically Freeze Object Viewer Windows
Database => Worksheet => Show query results in new tabs
However every time I run it using Ctrl+Enter, I get a new tab for the results. If I select just the query without the DEFINE statements, the same tab is reused.
How can I make SQL Developer to reuse the same tab when I also include DEFINE statements?