WhimsicalWhale
WhimsicalWhale

Reputation: 135

ORA-00907: missing right parenthesis?

I keep getting the following error when trying to execute the following WHERE condition but can't quite figure out what the actual problem is... any help is appreciated. Thanks!

WHERE ((CUSTOMER.CREATE_DATE >= TO_DATE($$EXTRACT_DT,'YYYYMMDD')) OR
(CUSTOMER.UPDATE_DATE >= TO_DATE($$EXTRACT_DT,'YYYYMMDD')))

NOTE: Would like to add that when I remove the WHERE condition, the query executes without any issues.

Upvotes: 0

Views: 615

Answers (2)

Fernando Garcia
Fernando Garcia

Reputation: 94

Try this:

WHERE (CUSTOMER.CREATE_DATE >= TO_DATE("$$EXTRACT_DT", 'YYYYMMDD') OR
       CUSTOMER.UPDATE_DATE >= TO_DATE("$$EXTRACT_DT", 'YYYYMMDD')
      )

Upvotes: 0

Gordon Linoff
Gordon Linoff

Reputation: 1271023

Your parens balance -- 5 ( and 5 ). I would write the code to make this obvious:

WHERE (CUSTOMER.CREATE_DATE >= TO_DATE($$EXTRACT_DT, 'YYYYMMDD') OR
       CUSTOMER.UPDATE_DATE >= TO_DATE($$EXTRACT_DT, 'YYYYMMDD')
      )

(This removes the parentheses on each clause.)

Hence, your problem would appear to be elsewhere in the query.

Upvotes: 2

Related Questions