title: OUT parameter of MySQL stored procedure is null after calling stored procedure
body: <p>I've created a stored procedure to return a value for row count of any table I pass in as an "IN" parameter, and output that rowcount to an OUT parameter</p>
  
  <pre><code>PROCEDURE `GetCount`(in tblname varchar(255), out rowcount int)
  BEGIN
      SET @sql_text1 = concat('SELECT COUNT(*) FROM ',tblname);
      SET @sql_text2 = concat(@sql_text1,' INTO ');
      SET @sql_final = concat(@sql_text2,  rowcount);
  
      PREPARE stmt1 FROM @sql_text1;
      EXECUTE stmt1;
      DEALLOCATE PREPARE stmt1;
  
  END
  </code></pre>
  
  <p>when I open a query window in MySQL workbench and do the following:</p>
  
  <pre><code>set @tablename = 'my_table_name;
  set @cnt = -9998;
  call GetCount(@tablename,@cnt);
  SELECT @cnt;
  </code></pre>
  
  <p>the value of @cnt is NULL.</p>
  
  <p>Is my method of testing the stored proc incorrect, or is the stored proc to blame?</p>