how to iterate through tables in a database

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Diane
Posts: 20
Joined: Wed Jun 01, 2011 10:02 pm

how to iterate through tables in a database

Post by Diane » Mon Jun 13, 2011 4:14 am

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

dglass
Posts: 519
Joined: Thu Sep 24, 2009 9:10 pm
Location: California
Contact:

Re: how to iterate through tables in a database

Post by dglass » Mon Jun 13, 2011 6:21 am

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:
Last edited by dglass on Mon Jun 13, 2011 3:03 pm, edited 1 time in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: how to iterate through tables in a database

Post by dunbarx » Mon Jun 13, 2011 2:49 pm

Typo, I expect.

repeat for each linTableName in tTableNames

is likely, repeat for each line TableName in tTableNames

dglass
Posts: 519
Joined: Thu Sep 24, 2009 9:10 pm
Location: California
Contact:

Re: how to iterate through tables in a database

Post by dglass » Mon Jun 13, 2011 3:03 pm

dunbarx wrote:Typo, I expect.
Yep. Oops. :oops:

Diane
Posts: 20
Joined: Wed Jun 01, 2011 10:02 pm

Re: how to iterate through tables in a database

Post by Diane » Mon Jun 13, 2011 7:12 pm

Thanks guys, it did the trick and it's working! :D

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”