title: FOR loop Netezza issue
body: <p>I'm working with stored procedures in netezza.
  I want to loop over a range of values.
  The upper bound on the loop is passed as a variable into the sproc by the user.</p>
  
  <p>i.e. EXECUTE SPROC(12);</p>
  
  <p>so problem is that Netezza (aginity workbench) won't accept this input variable as the upper bound on the loop.</p>
  
  <p>i.e. </p>
  
  <pre><code>DECLARE 
   x alias as $1.
  begin 
     for i in 1..x loop
       ...do stufff... 
      end loop; 
  end;
  </code></pre>
  
  <p>I know that this can be solved using loop and exit style loop but It's eating me up as to why i can't do the above given that the documentation suggests that it's possible to do so.</p>
  
  <p>Anyone know why this doesn't work or how to make it work?</p>
  
  <p>Thanks.
  Clancy.</p>