8 Replies Latest reply: Mar 25, 2014 12:48 PM by Archie Williams RSS

    Missing Parenthesis in SQL IF Statement?

      Hi All,

       

      Not sure what I am missing here in my Sql Statement. I keep getting the [Error] Execution: (ORA-00907: missing right parenthesis error

       

      LOAD

        *;

      SQL select

           fact.TRANSACTION_TYPE_ID,

          fact.TRANSACTION_DATE_ID,

          fact.TRANSACTION_ID,

          fact.MATERIAL_ID,

         IF(detail.Order_Type = 'FOR','1','2') as FOR_TYPE_ID,

           fact.BACKLOG_QUANTITY

      from BACKLOG_WEEKLY_FACT_MV fact,

           BACKLOG_HISTORY_MV detail

      where fact.TRANSACTION_ID = detail.BACKLOG_HISTORY_ID;

       

      Any help will be appreciated.

       

      Thanks in advance,

      Archie