2 Replies Latest reply: Oct 22, 2014 12:06 PM by Marco Wedel RSS

    Help on Generic Load

      HI ALl,

       

      I have seen so many posts on Generic Load.

       

      After writting Generic load statement (

      Table2:

      generic load *

      resident Table1

      )

       

      i see the below code

       

      ResultTable:

      LOAD Distinct ID, name Resident Table1;

       

      FOR i = 0 to NoOfTables()

        TableList:

        LOAD TableName($(i)) as Tablename AUTOGENERATE 1

        WHERE WildMatch(TableName($(i)), 'Table2.*');

      NEXT i

       

      FOR i = 1 to FieldValueCount('Tablename')

        LET vTable = FieldValue('Tablename', $(i));

        LEFT JOIN (ResultTable) LOAD * RESIDENT [$(vTable)];

        DROP TABLE [$(vTable)];

      NEXT i

       

      Drop Tables Table1, TableList

       

      Can anyone please make me understand the above code step by step what it is actually doing?  Is above mentioned code is common one?