This week's book giveaway is in the iOS forum.
We're giving away four copies of Classic Computer Science Problems in Swift and have David Kopec on-line!
See this thread for details.
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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
Marshal
Posts: 38146
617
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!)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!