Comment like /*a*/--b is sometimes invalid statement

A code that contains line comment directly after block comment is iterpreted as invalid and does not compile, for example:

/*a*/--b  <- ORA-00900: invalid SQL statement
/*a*/ --b  <- OK

This error happens when this kind of comment is not between begin end block but for example in file start/header comments.
Not sure when this has changed but Beta and 26.1 behave the same.

It looks like our parser is flagging this as an error which is causing Execute as Script (F5) to fail. Since this comment is outside of your DDL and you are compiling, you can simply use F9 to compile the object at caret. F9 will execute/compile the single statement at caret.

I will log this.

Michael

1 Like