Consider the following code snippet:
BEGIN
FOR rec IN (SELECT 2 FROM dual)
LOOP
NULL;
END LOOP;
END;
/
SELECT 1 FROM dual WHERE 1 = 0;
Now, when I select the bold/italic code sections, I can run them with the Run Statement button, or by hitting Ctrl+Enter, which is super convenient. However, I would also like to be able to click the Explain Plan (F10) or Autotrace (F6) buttons on the selection. When I do that on the first statement (embedded in the PL/SQL block) I get an error message "ora-00905 missing keyword". When I do that on the second statement, then the entire statement is explained / autotraced (including the WHERE clause), which I don't want when I select only parts of the statement.
This would be really useful when working with PL/SQL. Especially, if automatic bind variables could be generated this way, on the Explain Plan action!