3 Replies Latest reply: Oct 14, 2015 10:04 AM by Fernando Tonial RSS

    Incremental Load Fail - SQL command not properly ended

    Bryan Van

      New to incremental loading and getting hung up on the getting data after last update.  It feels like a solution that is easy but I cannot figure it out.  Hoping the Qlik community can help!

       

      This is an Oracle DB I'm querying to

       

      Load of UPDATEDATE field only from my QVD.  Others not needed for comparison


      //CMRSALES
      CMRSALES:
      LOAD UPDATEDATE
      FROM
      [C:\Users\Desktop\Qlik\CMRSALES.qvd]
      (
      qvd);

      Create LastUpdate field in DATE format of the DB. 

       

       

       

      //LastUpdate
      LastUpdateTime:
      LOAD DATE(MAX(UPDATEDATE),'MM/DD/YYYY hh:mm:ss TT') as LastUpdate
      resident CMRSALES;

       

      Set LastUpdateVar Variable to use for comparison

       

       

      //LastUpdateVariable
      Let LastUpdateVar = peek('LastUpdate',0,'LastUpdateTime');


      Comparison Load to get latest data from DB

       

       

       

       

      LOAD *;
      SQL SELECT *
      FROM GFXR.CMRSALESPNL
      WHERE UPDATEDATE>
      $(LastUpdateVar);

       

      Error Message.

       

      I can see LastUpdateVar is correct.  I've tried different variations of using UPDATEDATE as NUM(UPDATEDATE) or formatting

       

       

       

       

      ErrorSource: OraOLEDB, ErrorMsg: ORA-00933: SQL command not properly ended

      SQL SELECT *

      FROM GFXR.CMRSALESPNL

      WHERE UPDATEDATE>10/07/2015 11:59:19 PM