7 Replies Latest reply: May 2, 2011 2:45 PM by dcasanovac RSS

    Lost qv table field with reload

       

       

      Hello, i have a problem with the incremental reload , the error is

      Field <HORA> isnt found.

      Below the code......Help please i made many tests and nothing work.

      My clue its arround the some drop table or change the name but......

      Anyone?

       


      Trace 'Loading variables from file and QVD';
      Directory;
      LET QVDFILE='tb_qv';
      SET datatable='tb_qv';
      LET Listqvdexists=isnull(FileSize('$(QvdPath)\$(QVDFILE)'));///if qvd exists then 0 else -1
      LET QvdPath='X:';
      LET QvdFieldName=QvdFieldName('$(QvdPath)\$(QVDFILE)',1);

      if $(Listqvdexists)<0 then //if qvd file doesn't exist then make a full load
      Trace 'Se cargan Datos a tabla virtual='$(datatable);
      Trace 'No existe Qvd'$(QvdPath)\$(QVDFILE);
      $(datatable):
      SQL Select
      HOUR(current timestamp+1 hour) as Hora
      ,count(NUMBER_ID) as Q
      from DB_table;

      STORE $(datatable) INTO $(QvdPath)\$(QVDFILE);

      Else //if qvd Exists then make a full load.
      Trace 'Exists Qvd doing incremental';
      Trace 'Exists field?';
      tb_qv:
      SQL Select
      HOUR(current timestamp+1 hour) as Hora
      ,count(NUMBER_ID) as Q
      from DB_table;
      Concatenate
      LOAD Hora,Q FROM $(QvdPath)\$(QVDFILE) (qvd)
      WHERE NOT EXISTS ('$(QvdFieldName)');
      STORE $(datatable) INTO $(QvdPath)\$(QVDFILE);
      //Msj for load
      Trace 'Termina Incremental';
      end if
      exit script;