Page 1 of 1

how to iterate through tables in a database

Posted: Mon Jun 13, 2011 4:14 am
by Diane
How do I iterate through the list of table names in a database?
I'd like to create a generic database display, and I want to get the table names (using revDatabaseTableNames), and generate a list to iterate through.
Thanks!
Diane

Re: how to iterate through tables in a database

Posted: Mon Jun 13, 2011 6:21 am
by dglass
revDatabaseTableNames returns a list of tables, one per line, so after executing that command you should be ready for something like

repeat for each line linTableName in tTableNames
do something with linTableName
end repeat

EDIT: for typo. :oops:

Re: how to iterate through tables in a database

Posted: Mon Jun 13, 2011 2:49 pm
by dunbarx
Typo, I expect.

repeat for each linTableName in tTableNames

is likely, repeat for each line TableName in tTableNames

Re: how to iterate through tables in a database

Posted: Mon Jun 13, 2011 3:03 pm
by dglass
dunbarx wrote:Typo, I expect.
Yep. Oops. :oops:

Re: how to iterate through tables in a database

Posted: Mon Jun 13, 2011 7:12 pm
by Diane
Thanks guys, it did the trick and it's working! :D