RESTART_IDENTITY procedure
The RESTART_IDENTITY procedure examines the source-table and determines the identity column and its next value. The next value and column name are used to configure the target-table to use the same next value.
The schema is QSYS2.
- source-schema
- A character or graphic string for the schema name containing source-file. It must be a system schema name.
- source-table
- A character or graphic string for the table name that has the identity value to copy. It must be a system table name. The table must contain an identity column.
- target-schema
- A character or graphic string for the schema name containing target-table. It must be a system schema name.
- target-table
- A character or graphic string for the table name that is to have its identity column value reset. It must be a system table name. The table must contain an identity column that has the same name as the identity column in source-table.
Example
Set the identity column in NEWTABLE to have the same next value as the identity column in OLDTABLE
CALL QSYS2.RESTART_IDENTITY('OLDLIB', 'OLDTABLE', 'NEWLIB', 'NEWTABLE')