3 Replies Latest reply: Apr 28, 2015 5:10 AM by anbu cheliyan RSS

    How to get table name

    Kenny Hua

      Hello everyone,

       

      Actually I try to get the name of what I LOAD to another table:

       

      Table I want to get the name:

       

      CONCATENATE(NAME)

             LOAD A AS "FIELD1",

                       B AS "FIELD2",

                       C AS "FIELD3",

       

      Regards

        • Re: How to get table name
          Jose Maria Sanchez Herrero

          When you concatenate, your are adding these fields to your table called NAME.

           

          You can try this:

           

          NAME:

          LOAD *

               FROM [C:\...]

           

          MY_NEW_TABLE_NAME:

          noConcatenate LOAD A AS "FIELD1",

                           B AS "FIELD2",

                           C AS "FIELD3"

          FROM [C:\...]

           

           

          Then you will have two tables: NAME and MY_NEW_TABLE_NAME but if they have the same field names you will have a synthetic table

          • Re: How to get table name
            Gabriel Oluwaseye


            Hi,

             

            Naming a table is up to you to name the table with name relevant to the data you're loading. i.e. if you are loading Customer data, it make sense to name the table Customer or CUST. So if you're concatenate you just copy same table name above and paste it into the concatenate open and close bracket.

            • Re: How to get table name
              anbu cheliyan

              NAME:

              LOAD A AS "FIELD1",

                               B AS "FIELD2",

                               C AS "FIELD3",

                                "NAME" As TableName

              From NAME;

              CONCATENATE(NAME)

                     LOAD A AS "FIELD1",

                               B AS "FIELD2",

                               C AS "FIELD3",

                                "Name2" As TableName

              From Name2