How to reset auto generated id in a DB2 table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • anuritab@gmail.com

    How to reset auto generated id in a DB2 table

    Hi
    Is there a way to reset the auto generated id for this table. Drop
    table and recreating does not work.
  • Mark A

    #2
    Re: How to reset auto generated id in a DB2 table

    <anuritab@gmail .comwrote in message
    news:ebf88f96-d8b0-4dfc-85ed-a3a5c44ae4dd@i1 8g2000prn.googl egroups.com...
    Hi
    Is there a way to reset the auto generated id for this table. Drop
    table and recreating does not work.
    If you have DB2 for LUW, the information you want is in the SQL Reference
    Vol 2, under ALTER TABLE. Look at the ALTER COLUMN section and the "RESTART
    WITH n" clause.

    If you have DB2 for z/OS the SQL Reference is in a single volume (last time
    I checked).

    If you don't have a SQL Reference manual, you can download a searchable PDF
    version for free.


    Comment

    • Karl Hanson

      #3
      Re: How to reset auto generated id in a DB2 table

      Mark A wrote:
      <anuritab@gmail .comwrote in message
      news:ebf88f96-d8b0-4dfc-85ed-a3a5c44ae4dd@i1 8g2000prn.googl egroups.com...
      >Hi
      >Is there a way to reset the auto generated id for this table. Drop
      >table and recreating does not work.
      >
      If you have DB2 for LUW, the information you want is in the SQL Reference
      Vol 2, under ALTER TABLE. Look at the ALTER COLUMN section and the "RESTART
      WITH n" clause.
      >
      If you have DB2 for z/OS the SQL Reference is in a single volume (last time
      I checked).
      >
      If you don't have a SQL Reference manual, you can download a searchable PDF
      version for free.
      >

      And if you have DB2 for i5/OS (also supports ALTER .. RESTART WITH n),
      the SQL Reference is here:


      --
      Karl Hanson

      Comment

      Working...