p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_java thread: RE: How to find a size of a table in a database?


Message #1 by David@s... on Fri, 12 Apr 2002 15:46:56 -0400
I assume it's the number of records in the db, in this case:

"SELECT COUNT(*) FROM tblName"

Or to get the highest ID number:

"SELECT MAX(your id field) FROM tblName"

Dave

Message #2 by "Brian Walker" <BRIANPWALKER@p...> on Fri, 12 Apr 2002 19:38:09
> which database?

chanoch

MsAccess2002
thanks brian walker

-----Original Message-----
From: Brian Walker [mailto:BRIANPWALKER@p...]
Sent: 12 April 2002 03:11
To: Beginning Java
Subject: [beginning_java] How to find a size of a table in a database?


I just want the size of a table. I have a program that randomly gets data 
from a table but I need to know the size of the table in the database to 
limit the random number. 
brian walker 
thanks
---
Do you need true END-TO-END (e2e) Java Messaging (JMS)?  Softwired
offers industry's ONLY complete 100% JMS messaging solutions for your
needs TODAY.
Visit
http://adtracking.wrox.com/track.asp?x=p2p%2Fe%2Fjava%
2Dsoftwired&url=www.so
ftwired-inc.com Our unique product range includes: iBus//Mobile (wireless
data),
iBus//MessageBus (IP Multicast), iBus//MessageServer (store and forward)
and much more!

Message #3 by "Rich" <rpcee@o...> on Fri, 12 Apr 2002 19:57:38
select count(*) from <tablename>

works, don't know if there's a better way.

presumably you have a column in the table whose value is in the right 
range.
Message #4 by Chanoch Wiggers <ChanochW@w...> on Fri, 12 Apr 2002 13:11:39 +0100
which database?

chanoch

-----Original Message-----
From: Brian Walker [mailto:BRIANPWALKER@p...]
Sent: 12 April 2002 03:11
To: Beginning Java
Subject: [beginning_java] How to find a size of a table in a database?


I just want the size of a table. I have a program that randomly gets data 
from a table but I need to know the size of the table in the database to 
limit the random number. 
brian walker 
thanks
---
Do you need true END-TO-END (e2e) Java Messaging (JMS)?  Softwired
offers industry's ONLY complete 100% JMS messaging solutions for your
needs TODAY.
Visit
http://adtracking.wrox.com/track.asp?x=p2p%2Fe%2Fjava%2Dsoftwired&url=www.so
ftwired-inc.com Our unique product range includes: iBus//Mobile (wireless
data),
iBus//MessageBus (IP Multicast), iBus//MessageServer (store and forward)
and much more!

Message #5 by "Brian Walker" <BRIANPWALKER@p...> on Fri, 12 Apr 2002 02:10:53
I just want the size of a table. I have a program that randomly gets data 
from a table but I need to know the size of the table in the database to 
limit the random number. 
brian walker 
thanks

  Return to Index