title: how to set value to output parameter in dynamic sql procedure?
body: <p>I have tried with following code. But it shows error msg like this <code>undeclared variable :nt</code>. </p>
  
  <pre><code>CREATE DEFINER=`root`@`localhost` PROCEDURE `get_ntime`(in tb varchar(50),in d int, out nt varchar(50))
  BEGIN
     SET @statment = concat('Select ntime into nt from ',tb);
     SET @date = CONCAT(' WHERE date = "', d, '"');
     SET @statmen = CONCAT(@statment, @date);
     PREPARE stmt FROM @statment;
     EXECUTE stmt;
     DEALLOCATE PREPARE stmt;
  END
  </code></pre>