Obtaining _file based on a specific connected database

Posted by soumakdutta on 23-Feb-2009 09:19

Hello all. I'm new to progress and am trying to create an application that will obtain all the _file (or tables) of a database given the name of the database.

i have the following code but i'm not sure what to utilize for the WHERE clause:

FOR EACH _file WHERE DBNAME = "xxxxxx":

DISPLAY _file-name.



all i would like to do is get all the tables connected to a specific database since there are multiple databases connected.

Thanks in advance to any that can help.

All Replies

Posted by kevin_saunders on 23-Feb-2009 09:30

Look into the CREATE ALIAS statement and then, once created, use something like:

for each ._file...

Posted by Simon de Kraa on 23-Feb-2009 09:32

Instead of using DICTDB you could also do something like this...

Posted by ChUIMonster on 23-Feb-2009 09:32

By default _File (and its friends like _Field and _Index and so forth) are found in the DICTDB alias.

If you have multiple databases connected you just need to change the db that the DICTDB alias is pointing to. Check out the ALIAS function for details on how to create and manipulate db aliases.

Posted by soumakdutta on 23-Feb-2009 09:34

ah ok. thats what i was looking for. thank you! appreciate the help. i think i got it from here.

This thread is closed