title: MySQL ROW_COUNT() not working in Prepare statement
body: <p>What I'm doing.</p>
  
  <p>I've a procedure where I'm deleting rows.</p>
  
  <p>I'm getting <code>var_SelectedIds</code> as <code>,</code> separated <code>UUID()</code></p>
  
  <p>then </p>
  
  <pre><code>SET     @var_SQLStr = '';   
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,'Delete ');
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,'FROM DemoTable');        
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,'WHERE DemoTableId IN (''',Replace(var_SelectedIds,',',''','''),'''); ');
  
  -- SELECT @var_SQLStr;
  PREPARE stmt FROM @var_SQLStr;
  EXECUTE stmt;
  DEALLOCATE PREPARE stmt;
  </code></pre>
  
  <p>What I've alread tried.</p>
  
  <pre><code>// This is throwing SQL Syntax ERROR.
  
  SET     @var_SQLStr = '';   
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,'Delete ');
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,'FROM DemoTable');        
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,'WHERE DemoTableId IN (''',Replace(var_SelectedIds,',',''','''),'''); ');
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,' SELECT ROWS_COUNT() INTO @var_AffectedRows; ');
  
  -- SELECT @var_SQLStr;
  PREPARE stmt FROM @var_SQLStr;
  EXECUTE stmt;
  DEALLOCATE PREPARE stmt;
  </code></pre>
  
  <p><a href="http://dev.mysql.com/doc/refman/5.0/en/prepare.html" rel="nofollow">MySQL Reference</a></p>
  
  <blockquote>
    <p>The text must represent a single statement, not multiple statements.</p>
  </blockquote>
  
  <p>I also tried </p>
  
  <pre><code>START TRANSACTION;
  
  -- Other statements here
  
  SET     @var_SQLStr = '';   
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,'Delete ');
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,'FROM DemoTable');        
  SET     @var_SQLStr = CONCAT(@var_SQLStr ,'WHERE DemoTableId IN (''',Replace(var_SelectedIds,',',''','''),'''); ');
  
  -- SELECT @var_SQLStr;
  PREPARE stmt FROM @var_SQLStr;
  EXECUTE stmt;
  DEALLOCATE PREPARE stmt;
  
  SELECT ROW_COUNT() INTO @var_AffectedRows
  COMMIT;
  
  SELECT @var_AffectedRows AS NoOfRowsDeleted; // 0 output
  </code></pre>
  
  <p>I'm not able to get how may rows got deleted. </p>