By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,321 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,321 IT Pros & Developers. It's quick & easy.

Dynamic sql query

P: n/a
Hi Folks,
Can u help me out on a sql query:
Requirement is i need to print
table_name , columns_inside_table , rows_in_this_table of a particular
schema..
I have got 1 solution from using PLSQL , but i want to get the desired
output with sql qurey only.
I have partial solution of this:

"select table_name "Table Name" , count(*) "Columns" from
user_col_comments
/*((or v can also use user_tab_columns))*/ group by table_name;

This is giving me table_name and number of columns in this table but
not rows..

Can U guys help me on it..
Thanx & regs in advance..
Prashant Khanna.
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
To find out the number of rows in a table, use DBMS_STATS
(.GATHER_SCHEMA_STATS or .GET_TABLE_STATS) to analyze your tables (or
your whole schema), and you can afterwards use column NUM_ROWS of
table ALL_TABLES. Depending on which optimizer mode you use, you might
want to delete these statistics afterwards (with
DBMS_STATS.DELETE_SCHEMA_STATS or DBMS_STATS.DELETE_TABLE_STATS).

Daniel
Can u help me out on a sql query:
Requirement is i need to print
table_name , columns_inside_table , rows_in_this_table of a particular
schema..
I have got 1 solution from using PLSQL , but i want to get the desired
output with sql qurey only.
I have partial solution of this:

"select table_name "Table Name" , count(*) "Columns" from
user_col_comments
/*((or v can also use user_tab_columns))*/ group by table_name;

This is giving me table_name and number of columns in this table but
not rows..

Can U guys help me on it..
Thanx & regs in advance..
Prashant Khanna.

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.