beginner's question

Posted by Admin on 13-Jul-2006 00:27

hi, every one. I am a new man in progress.

I have a question here which i cannot find in my handbook.

how can i get a list of all the available tables in a specified database dynamically?

All Replies

Posted by Phillip Magnay on 13-Jul-2006 08:54

Welcome to the Progress community!

Information on tables defined within a given database is stored in the _File table. If you open the Data Dictionary tool on a specific database, and select View->Show Hidden Tables from the window menu, you will see the _File table in the tables list box.

To programmatically retrieve this information for a given database, it is just a matter of retrieving records from this _File table.

For example, the following code will list all the tables in the database including all the hidden/system tables.

FOR EACH _File NO-LOCK:

DISPLAY File.File-Name.

END.

The following code will filter out all the hidden/system tables:

FOR EACH _File NO-LOCK WHERE File.Hidden = FALSE:

DISPLAY File.File-Name.

END.

There is of course a lot more one can do with the _File table and the other "underscore" tables. But hopefully this should get you started.

Phil

This thread is closed