There are multiple solutions online but they all use ‘CREATE TABLE’ and ‘INSERT’ in their solutions.
I only have read access. So how to print all table names and row count in a schema? If possible how to print column count also, but it is optional.
There are multiple solutions online but they all use ‘CREATE TABLE’ and ‘INSERT’ in their solutions.
I only have read access. So how to print all table names and row count in a schema? If possible how to print column count also, but it is optional.
2
Answers
Answer for PostgreSQL.
For exact counts, you need dynamic SQL. Create a function like:
Call:
Or:
Related:
For very quick estimates:
Detailed explanation:
You need some tool which is able to interact with the DBMS_OUTPUT module module in Db2 for LUW.
For examle, the following code works, if you run it with the Db2 CLP tool.
But, if you use some other tool, then it depends on if this tool is able to work with INOUT parameters of Db2 stored procedures.
For example, you can do something like this in DBeaver:
Look at the SYSCAT.COLUMNS system view for column count info.