title: MySQL SQL syntax error near '0' at line 1
body: <p>I have tried various modifications to make this work but I can't seem to remove the error. My SQLQuery string is much larger than the one below but same set up. I tried using a <code>CONCAT(' ')</code> statement but had issues. So I tried using this format but still receive the same error. any suggestions?</p>
  
  <pre><code>CREATE DEFINER=`root`@`%` PROCEDURE `stp_Select_GetTbl`(IN strWhereClause 
  VARCHAR(255))
  BEGIN
  DECLARE SQLQuery varchar(1000); 
  
  SET SQLQuery = '
  SELECT `Part Num` AS `PPNumber`,
  `Shop Num` as `SOrder`
  FROM `track`.`s list` WHERE ';
  
  SET @SQLQuery = @SQLQuery + strWhereClause + '';
  
  PREPARE stmt FROM @SQLQuery;
  EXECUTE stmt;
  END
  </code></pre>
  
  <p>ERROR: </p>
  
  <pre><code>`Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0' at line 1
  </code></pre>
  
  <p>`
  I have tried not declaring SQLQuery... changing varchar size... reorganizing and even using the example below </p>
  
  <pre><code>SET @getList =
  CONCAT('SELECT (t1, t2, t3) FROM (SELECT t1, t2, t3) as mainSelect WHERE ', strWhereClause, '');
  
  PREPARE stmt FROM @getList;
  EXECUTE stmt;
  END
  </code></pre>
  
  <p>but get error at 
      <code>.... MySQL server version for the right syntax to use near '0</code></p>
  
  <p>I need to define a string for my SELECT statement because I create the WHERE clause in my stored procedure.</p>