DB2建立BIGINT自增序列

create table T_LOGOFF_ERR
(
   ID    BIGINT PRIMARY KEY    NOT NULL    GENERATED ALWAYS
    AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20,
       NO MINVALUE, NO MAXVALUE, NO CYCLE, NO ORDER),
   NUMBERPLATE          VARCHAR(24),
   IMPORTTIME           DATE
);

comment on table T_LOGOFF_ERR is
'导入的异常数据记录到这个表中';

comment on column T_LOGOFF_ERR.ID is

'取序列值';

或者

COMMENT ON "T_SYSTEMCONFIG" (
    "ID" IS '自增主键',
    "EXT1" IS '扩展字段1',
    "EXT2" IS '扩展字段2',
    "EXT3" IS '扩展字段3' );

你可能感兴趣的:(DB2建立BIGINT自增序列)