1 Reply Latest reply: Dec 14, 2012 5:47 PM by Fernando Suzuki RSS

    Drop Table $(variableTableName);

    David BONNAVENC

      Hi Guys,

       

      i'm trying to use a variable table name into the Drop Table instruction and that seems to not work as intended.

      Indeed, i'm working with tables generated according to variable names like :

       

      FOR EACH vInputFile In FileList('.\INPUTS\*')

           ...

           $(currenttablename)$(tablesuffix):

           LOAD * FROM InputFile;

           ...

           STORE $(currenttablename)$(tablesuffix) INTO '.\STORE\$(currenttablename)';

      NEXT vInputFile

       

      And after that, i have to purge memory :

      FOR iTableNo = 0 to NoOfTables()-1

           Let CurrentTable = TableName('$(iTableNo)');

           IF WildMatch(CurrentTable,'*$(tablesuffix)') THEN

       

                Drop Table $(CurrentTable);

       

           ENDIF

      NEXT

       

      My problem is that this statement : Drop Table $(CurrentTable);

      The variable table name seems to not be replaced correctly during execution, and QV return and error :  "Table unavailable : Drop Table statement"

       

      Is drop table working with variable table name ?

       

      Thanks in advance for your help.