Toad World® Forums

12.9.0.71 Editor issue

select sysdate from dual;–comment here

gives;

[Error] Execution (53: 25): ORA-00911: invalid character

select sysdate from dual–comment here

works just fine.

See the following documentation:

docs.oracle.com/…/ch5.htm

The parser seems to accept both statements. Shouldn’t it reject the first statement?

This comment applies to sql Plus,

Above you can see:

For PL/SQL and SQL, enter the comment after a command on a line, or on a line by itself:

Should I assume Toad’s behavior would be like in SQLPlus??

At first I could not reproduce so I selected all of that text and hit F9 and then see it. I assume you are selecting the statement and not just placing the caret on that line and pressing F9. The problem is the semicolon. For parsing it’s preferable to have it there, but for execution the ‘;’ causes that error. Toad will automatically detect the invalid char error, strip the ‘;’ and send it back to Oracle. This check and strip logic is very simple and does not scan backwards past comments looking for it. I’ll log this.

Fixed next beta.