4 Replies Latest reply: Jul 30, 2014 2:48 AM by Tobias Klett RSS

    How to use a variable in LOAD statement?

    Alam Nizami

      Hi,

       

      I want to load all my tables with a variable, so instead of the column names listed after the load statement I just want it to be a variable. That way I can load other tables and keep it running.

       

      Example (Currently being loaded like this below, with database info and column name being pulled through a variable from a excel file)

       

      There are multiple tabs and I Concatenate to MyTableName, and it works fine with using a variable for the database in the connection string.

       

      MyTableName:

       

      LOAD

       

           NameOfFirstColumn as Column1

           NameOfSecondColumn as Column2

           NameOfThirdColumn as Column3

           NameOfFourthColumn as Column4

       

       

      SELECT * FROM blank;

       

      But what I want to do is.. for example

       

      LET vLoadColumns ()?

       

      MyTableName:

       

      LOAD

       

           vLoadColumns:

       

      SELECT * FROM blank;

       

      Just like the variable for database cycles through the databases I want the data that is pulled after load to be stored in a variable and use that same variable to keep Concatenating MyTableName:

       

      Please let me know if you need more clarification.

       

      Thanks