This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

How to obtain a database table size?  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm not sure what to look for, so any pointers appreciated.

So far I've succeeded to connect to a MySQL database and insert data inside. What I'm trying to do next is to the verify that the new data actually made it to the DB, and then remove the old data from the DB.

I think I can do this by comparing the table size, but how does one obtain a certain table size? Which API should I be looking for? Thanks in advance!
 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the SQL Select to verify whether the new data has been inserted.

Getting table size using SQL is tricky and I'm not sure how reliable it is.
Also for your problem, SQL select would suffice.

To cut a blade of grass, your nails (SQL Select) are sufficient, axe (Table size) is an overkill option.
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most of the database returns the number of rows updated by the last statement.
You can use that to find out your operation was successful or nut.
 
author & internet detective
Posts: 39054
714
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"select count(*) from table" gives you the number of rows. I think you mean number of rows and not actual number of bytes in the table.
 
Tsehau Chao
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all the kind replies. I'll try to work them out! (Jeanne you're right, that IS what I mean!)
 
Poop goes in a willow feeder. Wipe with this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!