Post date: Jul 28, 2017 5:58:27 AM
SQL*Plus does not have a SQL or PL/SQL command parser. It scans the first few keywords of each new statement to determine the command type, SQL, PL/SQL or SQL*Plus. Comments in some locations can prevent SQL*Plus from correctly identifying the command type, giving unexpected results. The following usage notes may help you to use SQL*Plus comments more effectively
Do not put comments after statement terminators (period, semicolon or slash). For example, if you enter:
SELECT 'Y' FROM DUAL; -- TESTING
You get the following error:
SELECT 'Y' FROM DUAL; -- TESTING * ERROR at line 1: ORA-00911: invalid character
SQL*Plus expects no text after a statement terminator and is unable to process the command.
Do not put statement termination characters at the end of a comment line or after comments in a SQL statement or a PL/SQL block. For example, if you enter:
SELECT * -- COMMENT;
You get the following error:
-- COMMENT * ERROR at line 2: ORA-00923: FROM keyword not found where expected
Note: Please follow the Placing Comments in Scripts link for more information.