Skip to content
Advertisement

ORA-00907: missing right parenthesis. I am passing a Variable ‘&Coordinator_Id&’

ORA-00907: missing right parenthesis

I am trying to run the code and I am keeping getting the right parenthesis error I checked the entire code. Could somebody see why I am failing?

Advertisement

Answer

As mentioned in comments a case expression evaluates to a value, which you can then use or compare to something else. In a where clause it’s usually simpler to just use Boolean logic, so you can remove the case expression; and you can also remove a lot of the repetition and unnecessary subqueries against dual, to get something like:

Though the LIKE should probably be =, and the upper() in the not null check isn’t really doing anything – can’t tell if the others are necessary; and you could use an in() for the OBJSTATE checks.

I believe that capture the same logic as the version in your question.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement