title: MYSQL SP not looping
body: <p>I found a great SQL statement that will mask production data (<a href="http://moinne.com/blog/ronald/mysql/howto-generate-meaningful-test-data-using-a-mysql-function" rel="nofollow">Howto generate meaningful test data using a MySQL function</a>).</p>
  
  <p>I am attempting to add this as a stored procedure.</p>
  
  <p>When i run the function from a query, it works perfectly.</p>
  
  <p>However, when i call the function from a SP, the records are randomized, but with the same data.  How do I get the SP to randomized each record like the query call????</p>
  
  <p>So if I run this:</p>
  
  <pre><code>UPDATE MAINTBL 
    SET first_name = (SELECT str_random('Cc{3}c(4)')),
      last_name = (SELECT str_random('Cc{5}c(6)')),
      email = (SELECT str_random('c{3}c(5)[.|_]c{8}c(8)@[google|yahoo|live|mail]".com"')),
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code>first_name || last_name  || email
  ===========================================================
  Xstpvb     || Slbynwcigi || vgsbtnl_obpvhahigqkfte@live.com
  Vohv       || Nyeaqbn    || rtrc_nkjotdkpxhsrf@google.com
  Nkjpxqm    || Ogrosyjwi  || ystbfz.egrowrtsnq@live.com
  Mdig       || Cccepmxlla || tqxuwz.jzwjfborpufpi@mail.com
  </code></pre>
  
  <p>But when Iput it in a SP:</p>
  
  <pre><code>DROP PROCEDURE IF EXISTS mask_data;
  
  CREATE PROCEDURE mask_data()
    BEGIN
      UPDATE MAINTBL 
        SET first_name = (SELECT str_random('Cc{3}c(4)')),
          last_name = (SELECT str_random('Cc{5}c(6)')),
          email = (SELECT str_random('c{3}c(5)[.|_]c{8}c(8)@[google|yahoo|live|mail]".com"')),
  END;
  
  Then call it from a query:
      call mask_data;
  </code></pre>
  
  <p>I get the same output in each record:</p>
  
  <pre><code>first_name || last_name  || email
  Ofgtlmz    || Mndbynbepn || vpngah.vcaxkhhmgqkd@yahoo.com
  Ofgtlmz    || Mndbynbepn || vpngah.vcaxkhhmgqkd@yahoo.com
  Ofgtlmz    || Mndbynbepn || vpngah.vcaxkhhmgqkd@yahoo.com
  Ofgtlmz    || Mndbynbepn || vpngah.vcaxkhhmgqkd@yahoo.com
  </code></pre>
  
  <p>What am I doing wrong???</p>