Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

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

  




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 Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi333
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software