12 Replies Latest reply: Feb 24, 2017 2:37 PM by Eduardo DImperio RSS

    Concatenate variable with Table name

    Eduardo DImperio

      Hi Guys,

       

      Why this not work?

       

      [CFG_CARGA_INTEGRATION]:

      LOAD

        RowNo () AS ID,

          CONNECTION,

          CAMINHO,

          EXECUCAO

      FROM [lib://MI_csv/CONFIG_INTEGRACAO.xlsx]

      (ooxml, embedded labels, table is EXTRACT)

      WHERE UPPER(EXECUCAO) = 'S' AND  NOT ISNULL(EXECUCAO);

       

      Let v_Inicio = Num(Peek('ID', -1, 'CFG_CARGA_INTEGRATION'));

       

      for a=1 to v_Inicio

       

      Let vLib = FieldValue('CONNECTION',$(a));

      Let vPath = FieldValue('CAMINHO',$(a));

       

      CONCAT_TABLE_$(vPath):

       

      let vCarga=Timestamp(Today(),'YYYYMMDD');

       

      for a=0 to 2

       

       

      let vCarga=Timestamp(Today()-$(a),'YYYYMMDD');

      LOAD

      Distinct

      *

      FROM [lib://MI_csv/Leituras/Individual_Read/RS_INDIVIDUAL_READ_$(vCarga).qvd](qvd) where DATE_READ>TODAY()-2;

       

      next

       

      exit script

      Tabela_tmp.JPG