2 Replies Latest reply: Apr 25, 2017 8:41 AM by Leon Ling RSS

    How to drop all tables with exclusions.

    Leon Ling

      I am currently performing a binary load on the governance dashboard and there are some unwanted tables that impact performance. The problem is that some tables in PROD governance don't exist in DEV or QA governance.

       

      Is there a way to drop all tables except for a chosen few tables? I have tried the following:

       

      Drop All Tables Except

       

      but it doesn't drop all tables. It drops about half of the tables. The same goes for the following code:

       

      SET vexemptList= 'SessionTaskAuditMaster Governance_AD_Link AD_USERS Profit_Centers PC_LOB';
      LET vNoofTables = NoOfTables();
      
      For vTableNo = 0 to vNoofTables-1 ;
        //When one table get deleted the next in line get that number.So always delete first table in the list.
        //For example if there is 4 tables and loop already finished 2 times there will not be any value for TableName(3)
        vTableName = TableName(0) ;
      
        Let vIndex = Index('$(vexemptList)','$(vTableName)') ;
      
        If $(vIndex)=0  then
        DROP Table $(vTableName);
        ENDIF
        
      NEXT
      

       

       

      It only drops some and not all of the tables.

       

      Is there a way to drop all tables with exclusions? Thank you.