ALTER SEQUENCE

The ALTER SEQUENCE statement can be used to change a sequence in any of these ways:

Examples:

A possible reason for specifying RESTART without a numeric value would be to reset the sequence to the START WITH value. In this example, the goal is to generate the numbers from 1 up to the number of rows in the table and then inserting the numbers into a column added to the table using temporary tables. Another use would be to get results back where all the resulting rows are numbered:

  ALTER SEQUENCE ORG_SEQ
    RESTART

  SELECT NEXT VALUE FOR ORG_SEQ, ORG.*
    FROM ORG

For more information, see ALTER SEQUENCE in the SQL Reference topic in the Information CenterLink to Information center.