ALTER SERIAL

Description

With the ALTER SERIAL statement, you can update the increment of the serial value, set or delete its initial or minimum/maximum values, and set its cycle attribute.

Syntax

ALTER SERIAL serial_identifier

[ INCREMENT BY interval ]

[ START WITH initial_value ]

[ MINVALUE min | NOMINVALUE ]

[ MAXVALUE max NOMAXVALUE ]

[ CACHE integer | NOCACHE ]

Caution In CUBRID 2008 R1.x version, the serial value can be modified by updating the db_serial talbe, a system catalog. However, in CUBRID 2008 R2.0 version or above, the modification of the db_serial table is not allowed but use of the ALTER SERIAL statement is allowed. Therefore,if an ALTER SERIAL statement is included in the data exported (unloaddb) from CUBRID 2008 R2.0 or above, it is not allowed to import (loaddb) the data in CUBRID 2008 R1.x or below.

Example

--altering serial by changing start and incremental values

ALTER SERIAL order_no START WITH 100 INCREMENT BY 2;

 

--altering serial to operate in cache mode

ALTER SERIAL order_no CACHE 5;

 

--altering serial to operate in common mode

ALTER SERIAL order_no NOCACHE;