Topic: SQL*Plus and PL/SQL >> About Number of Rows in a table
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: About Number of Rows in a table |
| bhmadhukar |
Posted: Feb 20, 2008 08:35:59 AM |
Total Post: 14
Joined: Jan, 2008
|
if i give below query,
select num_rows from user_tables where table_name like 'EMP';
output: default it has 14 rows & it is returning 14 rows.
but, i created a table with name EMPLOYEE (table) and inserted 5 rows. Again, i gave the query like below,
select num_rows from user_tables where table_name like 'EMPLOYEE';
output: it is not returing number of rows.
any solution or reason?
thanx in adv.
|
|
|
Mohammed Taj |
| Posted: Feb 20, 2008 10:23:05 AM | |
|
Total Post: 746
Joined: Jul, 2007
|
you have to first analyze your new created table then query in dba_tables views.
1. create table a ( no number)
2. insert into a (100);
commit;
3. exec dbms_stats.gather_table_stats('TABLE','A');
4. select table_name,num_rows from dba_tables where table_name='A';
Regards
Taj
YOu have to always gather statistics to populate dictionary tables.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 333 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|