8 Replies Latest reply: Aug 8, 2018 8:22 AM by Sunny Talwar RSS

    Generic script to delete all tables

    omar bensalem

      Hi all,

       

      After constructing my model (tables); my main purposes were:

       

      1) Store all tables in QVDs:

       

      FOR i = 0 to NoOfTables()-1 

      LET vTabName = TableName($(i)); 

      STORE $(vTabName) into [lib://blabla/QVD/$(vTabName)$(vSaveFile).qvd] (qvd); 

       

      NEXT i 

       

      2) drop all the tables (after storing them in qvds) :


       

      //drop tables

      FOR j = 1 to NoOfTables()

      LET vTabName2 = TableName($(j)); 

      Drop table "$(vTabName2)";

       

      NEXT j 

       

       

      The problem is that the first part (storing the tables works perfectly) while the second one does not.

      In fact, from the 15 tables I have, some are deleted and nearly the half ARE NOT.


      I have tried :

      Drop table "$(vTabName2)";

      Drop table '$(vTabName2)';

      Drop table $(vTabName2);

      Drop table vTabName2;



      Nothing works as expected...

      When I try the same script with inline tables, all is deleted !


      Any idea on what could be the cause of such a behaviour? Thanks