title: MySQL: How to set a local variable using select in a stored procedure?
body: <p>It seems like this must be a dumb question :) but I can't seem to find it posted any where. </p>
  
  <p>I need to set a number of local variables in a sproc from a select statement. </p>
  
  <p>This works from the query window: </p>
  
  <pre><code>select  @value1 := value1, @value2 := value2 from test_table limit 1; 
  select  @value1, @value2;
  </code></pre>
  
  <p>But when I try and do a similar thing in a stored procedure, I get: 
  SQL Error (1064):You have an error in your SQL syntax... </p>
  
  <pre><code>BEGIN
  
      declare p_value1 varchar(50); 
      declare p_value2 varchar(50); 
      select  p_value1 := value1, p_value2 := value2 from test_table limit 1; 
  
  END
  </code></pre>
  
  <p>Any help appreciated. </p>