title: MySQL stored procedures - How to use parameter in FROM clause
body: <p>I have the following stored procedure:</p>
  
  <pre><code>DELIMITER ///
  
  CREATE PROCEDURE tmp_test_proc(__TABLE__NAME varchar(255))
  BEGIN
    SELECT COUNT(*) FROM __TABLE__NAME;
  END///
  
  DELIMITER ;
  </code></pre>
  
  <p>I would like to select from the parameter <code>__TABLE__NAME</code>, but MySQL tells me there is no table <code>__TABLE__NAME</code>... So is there a way to use the value of the parameter in the from clause?</p>