19 Replies Latest reply: Feb 8, 2018 8:27 AM by Baarathi V RSS

    Increamental Load ODBC connected (sql data)

    Baarathi V

      LastUpdatedDate:

                 Load

                     max(Date("TDate")) as MaxDate;


      Let varLastExec = Date(Peek('MaxDate', 0, 'LastUpdatedDate'));

      Let varThisExec = Date(Now());


      M:

      LOAD

          TDate,

          "ANO",

          BILL,

          PAY,

          "SDATE",

          "DNO",

           ADJ,

          COM,

          Cheq,

          "mk",

          "user",

          tkey,

          place,

          "icode",

          pkey;

      Concatenate

           Load TDate,

          "ANO",

          BILL,

          PAY,

          "SDATE",

          "DNO",

           ADJ,

          COM,

          Cheq,

          "mk",

          "user",

          tkey,

          place,

          "icode",

          pkey from lib://QVDs/xyz.qvd

           where not Exists(thekey);

      inner join

      load tkey;

      sql select tkey from PAN.T;


      if ('$(ScriptErrorCount)') = 0 then

      Store M into [lib://QVDs/temp.qvd](qvd);

      Let varLastExec = '$(varThisExec)';

      endif

          


      SQL SELECT

          "TDate",

          "ANO",

          BILL,

          PAY,

          "SDATE",

          "DNO",

           ADJ,

          COM,

          Cheq,

          "mk",

          "user",

          tkey,

          place,

          "icode",

          pkey

      FROM PAN.T

      where date(TDate) <= #'$varLastExec'#;


      I was trying for increamental load, but there is an error occured while script is loaded, Is the above script correct to perform increamental load ?