title: What is the use of WITH RETURN clause in DB2?
body: <p>I see several stored procedures in this application I am now responsible for, some of which use this syntax for cursors:</p>
  
  <pre><code>DECLARE cursor1 CURSOR WITH RETURN FOR 
  </code></pre>
  
  <p>...and others that use this syntax for cursors:</p>
  
  <pre><code>DECLARE cursor1 CURSOR FOR 
  </code></pre>
  
  <p>All of these stored procedures are used by Crystal Reports 11.
  Please explain to me, what is the difference between these two?  They both return rows to Crystal Reports successfully.  I am trying to optimize this one stored procedure and I wasn't sure what this clause even does.  Thanks for your help.</p>