title: How do I get the next value that will be used on an IDENTITY column
body: <p>I am using DB2 v9 on LUW.</p>
  
  <p>I have a column defined like this:</p>
  
  <p><code>
      "ID" BIGINT NOT NULL GENERATED BY DEFAULT<br>
     AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20,<br>
      NO MINVALUE, NO MAXVALUE, NO CYCLE, NO ORDER),<br>
  </code></p>
  
  <p>I would like to know the best way to determine what the next value will be for the ID column next time a record is inserted into the table.</p>
  
  <p>I will use this information to write a script to do a "sanity" check on the table that IDENTITY is still intact and that its next value is one greater than the highest value in the ID column.</p>
  
  <p>I do not want to just reset the value blindly.  If the table does not pass the sanity check I want to be notified so I can determine what is causing the IDENTITY to be "wacked".</p>