Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving the number of records in a table

Status
Not open for further replies.

davideart

Programmer
Apr 4, 2001
55
IT
Hi everyone.
Is there a way to find out how many records are contained in a specific DB2 table without using SELECT COUNT...FROM the table?
For example, is there a SYS table which contain this (or a similar) information?
I cannot use the SELECT COUNT...FROM because I show a list of DB2 table in an .asp page over the internet; if one or more table of the list contains a lot of records (say more than 100.000) and I retrive it with SELECT COUNT...FROM my web page is really too slow to load.

Any help will be greatly appreciated.

Thanks in advance
David
 
Hi David,
I believe there is a column on SYSIBM.SYSTABLES called CARD which holds the information that you require. Unfortunately I think that it only gets updated when RUNSTATS is run, and so therefore does not show the realtime picture. If the tables have RUNSTATS run against them every evening and are not high volume changing data, this may be acceptable. If you require the absolutely correct number, then I don't think that you can do it via the SYSIBM route.

Regards,
Marc
 
Hi Marc, thanks a lot for your tip, it can be quite valuable for me.

Best wishes, David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top