Marcus Leon
Marcus Leon

Reputation: 56699

Liquibase returning ORA-00907 with SQL using Oracle comment notation (double dash)

Running SQL on Oracle through Liquibase and getting error:

ORA-00907: missing right parenthesis

The SQL we're running has double dashes -- which can also represent comments in PLSQL. I'm guessing this is the issue. Should this be escaped somehow?

delete from mytable B where B.NAME in ('XXX--YYY', 'AAA--BBB');

Upvotes: 1

Views: 255

Answers (1)

Marmite Bomber
Marmite Bomber

Reputation: 21115

The sequence of the characters --is most likely interpreted as a comment, so the following charactes until the end of the line are ignored.

You may use following workaround, simple splitting the string in two parts

Instead of

'XXX--YYY'

use

'XXX-'||'-YYY' 

Do not forget, if you have more dashes, you must repeat stis step , e.g. for --- you must split the string in three part.

Posible similar problem would be for string containing the multiline comment:

'XXX/*YYY', 'XXX*/YYY'

Upvotes: 2

Related Questions