Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query 1

Status
Not open for further replies.

trutta1

IS-IT--Management
Apr 10, 2007
11
0
0
US
I need to write a query that will list table name and the number of columns in each table.

example of results:

table_name + # of COLs
table_one | 20
table_two | 350

.
.
.
 
What version of PSQL are you using?
This one works with PSQL v9.5:
select xf$name, count(xe$name) from x$field, x$file where xe$file = xf$id group by xf$name

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
now how do I add the number of bytes in a record and the number of rows in the table to the query
 
That data is not directly available. The bytes in the record could be counted by using the sum of the XE$SIZE field for each of the tables. THe record count is not going to be available without issuing a "SELECT COUNT(*) FROM table" query.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top