You can write the SQL once in the SQL Editor window, then use:
Editor > Add to Named SQLs
and give it a name.
For instance, you could use the following SQL:
SELECT DBMS_FLASHBACK.get_system_change_number SCN
FROM DUAL ;
and assign it the name “SCN” in Named SQLS.
Then, when you are in the SQL Editor, you can press Control-n, which will bring
up a dropdown of all your Named SQLs. Select the one you want, and it will be
pasted into the SQL Editor. I normally run it by pressing Shift-F9.
If you have multiple long SQL statements, you might want to save them somewhere
else also, so that in case they ever get lost due to e.g., a PC crash, you can
re-create it manually in the same fashion as described above.
Someone else will have to comment on the export to Excel, that’s not something I
do with any frequency.
image001.gif (43 Bytes)