473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Count all records in all tables

I need some help with this. I was able to count all the records in our
database using the user_tables and user_tab_columns tables after
refreshing the statistics on this database.
We are doing an upgrade of a system and I will not be able to refresh
the statistics during the upgrade. I need more of a manual process of
running these queries.

Now I do:
select A.table_name, round(A.num_rows,0) as rowcount,
count(b.table_name) as ColumnCount
from dba_tables A, dba_tab_columns B
where A.table_name = B.table_name and A.owner in ('PS','SYSADM')
group by A.table_name, A.num_rows
order by rowcount desc, columncount desc

But I can't use the num_rows anymore so I was thinking more to do this:

Select A.table_name from
(select count(*) from A.Table_name B where A.Table_name =
B.Table_Name)
from user_table

This does not work for me since I don't know how to pass the table_name
from the first select to the second select. The logic is there but the
syntax is not.
Please help.

Apr 13 '06 #1
1 2565
Do you think this is the right group ? You are refering to oracle
tables / dynamic views.

HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---

Apr 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rich Protzel | last post by:
Hello, If I run an action SP from MS Access using ADO: ... cmd.execute where the SP is something like Create... Update tbl1 set fld1 = 'something' where... how can I retrive the count of...
2
by: Dyslexic Fingars | last post by:
Warning I'm new to anything other than basic SQL so this 'might' seem like a daft question. My problem is - I've have two tables one hold's photo details and is called 'PhotoTable' it is linked...
1
by: Henry Stockbridge | last post by:
Hi, I am doing database documentation and run the procedure below to list the record count for each table in the database. The results in the immediate window only a partial listing of tables. ...
1
by: jnikle2100 | last post by:
I have a simple database comprised of two tables. tbl_employee_info stores employee info (name, hire date, title, etc.) and tbl_departmental_history stores departmental transfer history. The two...
3
by: Hyphessobricon | last post by:
Hallo, Indeed, a count of a query with a group by function gives more records than there are and so for-next structures don't function. How is this to be mended. Anyone? Everyone in fact....
4
by: Peter W Johnson | last post by:
Hi guys, I have a problem with a datagrid record count. Here is the code:- <snip> Public Class frmMerchantDeposit Inherits System.Windows.Forms.Form Dim myconnection As New...
4
by: max | last post by:
I am beginning to learn sql and need some help. I have a table of customers with their addresses. Let's say I want to run a query returning the number of customers whose last name is "Smith" by...
1
by: Jimmy | last post by:
I hate to ask such an ambiguous question but...what are some possible causes of getting #Error in a text box with =Count() as the control source. I have a form with a text control on the form...
6
markrawlingson
by: markrawlingson | last post by:
Hopefully someone can help me out with this, it's driving me nuts... I have two tables - We'll call them table1 and table2. Table1 holds event information, and table2 holds user registration data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.