title: Why does FETCH FIRST N ROWS not work in combination with WITH statement?
body: <p>I have the following SQL statement which does not run on my DB2 database:</p>
  
  <pre><code>WITH a AS (
      SELECT * FROM sysibm.systables
  )
  SELECT a.* FROM a
  FETCH FIRST 10 ROWS
  </code></pre>
  
  <p>Without the <strong>FETCH</strong> statement it works. The error message I get is: </p>
  
  <blockquote>
    <p>Illegal use of keyword OPTIMIZE, token ERR_STMT
    WNG_STMT GET SQL SAVEPOINT HOLD FREE
    ASSOCIATE was expected.</p>
  </blockquote>
  
  <p>Any suggestions? </p>