title: mysql append local variable inside a cursor
body: <p>Having a brain fade moment and can't remember how to do the following:</p>
  
  <p>I have a cursor inside a stored procedure that's looping through a table of addresses.
  I am trying to build up a string variable of all the addresses found so that once the loop ends I can update a single column in another table with all the addresses found as a single string</p>
  
  <p>Inside my cursor I have the following:</p>
  
  <pre><code>SET v_pDetails = CONCAT(v_Type,": ",fnc_get_Address(v_padr),CHAR(13));
  </code></pre>
  
  <p>But all I get in my string is the last record found not the list</p>
  
  <p>So I tried: </p>
  
  <pre><code>SET v_pDetails = CONCAT(v_pDetails,v_Type,": ",fnc_get_Address(v_padr),CHAR(13));
  </code></pre>
  
  <p>and </p>
  
  <pre><code>SET v_pDetails = v_pDetails 
                 + CONCAT(v_pDetails,v_Type,": ",fnc_get_Address(v_padr),CHAR(13));
  </code></pre>
  
  <p>But they give me nothing</p>
  
  <p>Any help please?</p>