16 Replies Latest reply: Nov 22, 2016 4:13 PM by David Bockol RSS

    Where Clause with ODBC Connection

    David Bockol

      I am using a where clause to filter data that is loaded via an ODBC connection.  I've tested the same where clause in an alternative qvw document which reads from a csv file and the syntax works without error.  Why doesn't the syntax work when there is an ODBC connection.

       

      WHERE ([ENTITY_STATUS] ='A' AND [ORIGINAL_EFF_DATE]<=20151031) OR ([ENTITY_STATUS] ='T' AND [ORIGINAL_EFF_DATE]<=20151031 AND [TERMIN_DATE]>20161031);

        • Re: Where Clause with ODBC Connection
          Vishwarath Nagaraju

          Can you put your ODBC connection outside your table name like: Check if this works?

           

          ODBC CONNECT32 TO ADGDTAPR (XUserId is SLIMISJMPbYCDRD, XPassword is RTCIbHJOBTbOWSNOSBMA);

           

           

          //-------- Start Multiple Select Statements ------

          T1_ACTIVE:

           

          SQL SELECT ACCOUNT_NO,

              BASE_PREMIUM,

              CUSTOMER_NO,

              ENTITY_STATUS,

              ORIGINAL_EFF_DATE,

              POLICY_EFF_DATE,

              POLICY_TYPE,

              PROFESSION_FLAG,

              SOURCE_CODE,

              STATE_CODE,

              STUDENT_FLAG,

              TERMIN_DATE

              FROM S40TREV.ADGDTAPR.NSOCVGP

              WHERE ([ENTITY_STATUS] ='A' AND [ORIGINAL_EFF_DATE]<=20151031) OR

                    ([ENTITY_STATUS] ='T' AND [ORIGINAL_EFF_DATE]<=20151031 AND [TERMIN_DATE]>20161031);

          • Re: Where Clause with ODBC Connection
            Sunny Talwar

            Does this query works in Toad or another query tool?

             

            SQL SELECT ACCOUNT_NO,

                BASE_PREMIUM,

                CUSTOMER_NO,

                ENTITY_STATUS,

                ORIGINAL_EFF_DATE,

                POLICY_EFF_DATE,

                POLICY_TYPE,

                PROFESSION_FLAG,

                SOURCE_CODE,

                STATE_CODE,

                STUDENT_FLAG,

                TERMIN_DATE

                FROM S40TREV.ADGDTAPR.NSOCVGP

                WHERE ([ENTITY_STATUS] ='A' AND [ORIGINAL_EFF_DATE]<=20151031) OR ([ENTITY_STATUS] ='T' AND [ORIGINAL_EFF_DATE]<=20151031 AND [TERMIN_DATE]>20161031);