title: Unknown Column 'template' in where clause, while using a stored procedure
body: <p>I have a stored procedure, which has got executed without any errors, but gives me an error "#1054: Unknown column 'templateName' in where clause" when I run it.</p>
  
  <p>The stored procedure is:</p>
  
  <pre><code>delimiter //
  DROP PROCEDURE `getData`//
  CREATE DEFINER=`root`@`localhost` PROCEDURE `getData`(IN templateName VARCHAR(45),IN templateVersion VARCHAR(45),IN userId VARCHAR(45))
  BEGIN
      set @version = CONCAT("SELECT 'saveOEMsData_answersVersion' FROM `saveOEMsData` where 'saveOEMsData_templateName' = ",templateName," and 'saveOEMsData_templateVersion' = ",templateVersion," and 'saveOEMsData_userId'= ",userId); 
      PREPARE s1 from @version;
      EXECUTE S1;
  END
  //
  delimiter ;
  </code></pre>
  
  <p>Now I call it using <code>call getData('templateName','1','285');</code>. And whenever I call it, I get the mentioned error. What could the problem be?? It surely is syntactical, I have been reading the mysql manuals for 2 days and have come out without!!</p>
  
  <p>Any help would be great!! Thanks</p>