3 Replies Latest reply: Mar 12, 2018 9:03 AM by Ishtdeep Singh RSS

    Load if File already not Loaded

    Francisco Pedrosa

      Hi,

       

      On a daily basis i have to load a File which contains several records. This file i keep in a Control Table. I would like to know how can i check if the file was already loaded, and if so, will not load the file contents.

       

      I have the following:

       

      /* records in table A may repeat */

      [Table A]

      Concatenate (Table A)

      Load

           codjogador,

           name,

           birthday,

           deposit,

           cashout

            $(vFile) as FileName,

      from [$vFile]

      (XmlSimple, table is [ficheiro/registos_jogador/jogador]);

       

      [TB_ETL_CONTROL]:

      Concatenate (TB_ETL_CONTROL)

      LOAD *,

          Timestamp(Now(1),'YYYY/MM/DD hh:mm:ss') as ETL_TIMESTAMP,

              ComputerName() as ETL_COMPUTER,

              ClientPlatform() as ETL_PLATFORM,

              DocumentName() as ETL_APP,

              OSUser() as ETL_USER,

              GetCollationLocale() as ETL_LOCALE

              INLINE

          [ETL_CTRL_PROC, ETL_FILENAME,

          'ETL - JGDR' , '$(vFile)'];


      What i would need to do is check if $(vFile) is already upoaded on TB_ETL_CONTROL and if not then upload it to TABLE A.


      Thanks in Advance,


      Francisco