Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the following oracle query. When I try to execute this query it throws the error- ORA-00907 missing right parenthesis. I am sure about all the open braces are closed. I think the problem with is COALESCE function otherwise the query works fine. Any work arounds?
SQL
Select * From A

AND (('1-Nov-2010' between OM_MERCH_CUST.MC_FM_DT AND coalesce (OM_MERCH_CUST.MC_TO_DT,sysdate()))

OR('30-Nov-2010' between OM_MERCH_CUST.MC_FM_DT AND coalesce (OM_MERCH_CUST.MC_TO_DT,sysdate())));
Posted
Updated 30-Oct-10 18:08pm
v3
Comments
Hiren solanki 30-Oct-10 3:11am    
Pre tag fixing.
Abhinav S 31-Oct-10 0:08am    
Minor edit.

1 solution

Re-formatting your statement so braces are aligned:
SQL
Select * From A
AND 
  (
    (
      '1-Nov-2010' between OM_MERCH_CUST.MC_FM_DT AND coalesce 
      (
        OM_MERCH_CUST.MC_TO_DT,sysdate
        (
        )
      )
    )
  OR
    (
      '30-Nov-2010' between OM_MERCH_CUST.MC_FM_DT AND coalesce 
      (
        OM_MERCH_CUST.MC_TO_DT,sysdate
        (
        )
      )
    )
  );
You have the right number of braces, but did you mean to have the OR clause within the AND?
 
Share this answer
 
Comments
Hiren solanki 30-Oct-10 5:31am    
A good visualized answer.
RDBurmon 31-Oct-10 6:20am    
Agreed with Hiren comments. good OriginalGriff

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900