Skip to Main Content

SQL Developer for VS Code

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with explain plan (F10)

If there is a comment on the same line as the query, when trying to generate an execution plan using the F10 shortcut, an error occurs:

==========================================================

query:

select  * from employees where department_id = 80; -- full

or

select  *
from employees
where department_id = 80; -- full

click F10

Error starting at line : 2 in command -
                    EXPLAIN PLAN SET STATEMENT_ID = '1733669821252' FOR select  * from employees where department_id = 80 -- full;

                    SELECT PLAN_TABLE_OUTPUT FROM TABLE(
                        DBMS_XPLAN.DISPLAY('plan_table', '1733669821252', 'TYPICAL')
                    )
Error report -
ORA-00933: SQL command not properly ended

https://docs.oracle.com/error-help/db/ora-00933/00933. 00000 -  "unexpected keyword at or near %s"
*Cause:    An unexpected keyword was encountered in the SQL statement at
           or near the position printed in the error message.
           One of the following occurred:
           1. You had a typo in your SQL statement.
           2. Unsupported syntax was encountered for a clause in the
           statement.
           3. An unsupported clause was encountered in the statement.
           4. A string was terminated prematurely leading to the rest
           of the string to be interpreted as keywords. For example, an
           apostrophe in the string may be causing it to
           end prematurely.
*Action:   Take the action that corresponds with the Cause
           1. Check that your SQL statement has no typos.
           2. Check Oracle Database documentation to find the
           correct syntax for the clause and update the problematic
           clause appropriately.
           3. Check Oracle Database documentation to find the correct
           syntax for the statement and remove the unsupported clause.
           4. Enter two single quotes instead of one to represent an
           apostrophe within a string.
*Params:   1) keyword_value
           keyword near the keyword causing the error. The keyword value
           may be truncated for readability if it is too long.
This post has been answered by Monika Lewandowska on Apr 15 2025
Jump to Answer
Comments
Post Details
Added on Dec 8 2024
2 comments
325 views