1 Reply Latest reply on May 16, 2009 4:25 AM by LaRetta_1

    Generating a list of table names



      Generating a list of table names


      How can I generate a list of tablenames from a given file?  TableNames (Get (FileName)) is giving me the table occurances but I just need the names.



        • 1. Re: Generating a list of table names

          There is no difference between a table and a table occurrence.  But I understand why you want it and you can 1) simply print your list of tables by going to Define Database and (below) print or 2) specify a certain table occurrence to represent your 'base' table by the way you name it.  Just be sure it begins with a character never used in any other table occurrence naming.


          So, for instance, if you begin your 'base' tables as :customers, :invoices, :Products ... you can then easily identify which table you consider your base and they are easy to list and grab.  A calcultion to find all base table could then be:


          Let ( [
          tables =  TableNames ( Get ( FileName ) ) ;
          n = PatternCount ( tables  ; ":" )
          ] ;
          LeftValues ( tables  ; n )
          ) //end let