Sql statement to return all tables in a Database in progress

roncansan

New Member
Hi,

Thanks for your help.

I'm developing like an "MSSQL Enterprise Manager" for Progress in .net.
By the way if some one knows one for free please let me know.

I'm starting by the basics, a sql statement to return all tables in a database,
can some one help me?

something like


SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
ORDER BY TABLE_NAME


Thanks
 

tamhas

ProgressTalk.com Sponsor
What you want to find is a copy of the Engine Crew monograph on the schema tables. I would point you to the one I know about on the PEG site, but that part is still down from the crash. I think Chris might have some or all of the monographs around here, but I don't know where.

The first two files you are interested in, though, are probably _file and _field. Like many of the metaschema files they join on RECID.
 

Casper

ProgressTalk.com Moderator
Staff member
Code:
select "_file-name" from pub."_file" where "_file"."_hidden" = 0

Should do the trick.

Casper.
 

DevTeam

Member
The first two files you are interested in, though, are probably _file and _field. Like many of the metaschema files they join on RECID.
I'd like to add to Thomas' post the fact that I had to deal with ROWID on the right side of the join (Java / JDBC) :
Code:
SELECT * FROM pub.\"_field\" WHERE \"_file-recid\" = (SELECT ROWID FROM pub.\"_file\" WHERE \"_file-name\" = YourTableName)
 

roncansan

New Member
Thanks,

one question I think that the following sql statement

SELECT * FROM pub.\"_field\" WHERE \"_file-recid\" = (SELECT ROWID FROM pub.\"_file\" WHERE \"_file-name\" = YourTableName)

Dose this statement returns all the fields "columns" from a table? I think so because the parameter YourTableName; But I want all the tables from a database or user. I don't know if progress store the tables under a DB like mssql or under a user like oracle.

Thanks
 

tamhas

ProgressTalk.com Sponsor
All tables in a Progress DB have an owner. That is what the PUB. prefix is about.
 

roncansan

New Member
Thanks,

For my DB it was

select _file-name from pro1._file where _file._hidden = 0

I'm surprise by the fast help all of you provide me
 
Top