MySQL Forums
Forum List  »  Stored Procedures

Re: Count Table rows using Stored Procedure
Posted by: A. Aquiles
Date: February 09, 2018 03:52AM

Thanks for the quick reply Peter.

Two issues:

1) table_schema is with an underscore (I noticed but some people may not).

2) More importantly, the information-schema gives *approximate* figures (e.g. in my case a table with exactly 83,290 appeared as having 83,727 rows).

That was the reason to use count(*) inside an stored procedure.

Re the printing, yes, creating a variable @totalcount and then "select @totalcount" shows the result on screen fine.

Options: ReplyQuote

Written By
Re: Count Table rows using Stored Procedure
February 09, 2018 03:52AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.