添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

describe indexes for table <instancename>.<tablename>

describe indexes for table db2inst1.aaa

二、删除表主键。

alter table <instancename>.<tablename> drop primary key

alter table db2inst1.aaa drop primary key

三、建立表主键。

alter table <instancename>.<tablename> add CONSTRAINT <primarykeyname> PRIMARY KEY (<columnname>)

alter table db2inst1.aaa add constraint aaa_pk primary key(id)

--分配结余、备注
ALTER TABLE DMS.PT_MONTHLYCLOSING ADD COLUMN NRALBL DECIMAL(14,2);
ALTER TABLE DMS.PT_MONTHLYCLOSING ADD COLUMN NSDEMO VARCHAR(500);

--2015-05-12
ALTER TABLE DMS.PT_MONTHLYCLOSING ADD COLUMN FLOWNO VARCHAR(50) NOT NULL DEFAULT '0';
UPDATE DMS.PT_MONTHLYCLOSING SET FLOWNO = CHAR(ACCESS_DATE)||'*'||MAINTENANCE_CD||'*'||SORTING;
ALTER TABLE DMS.PT_MONTHLYCLOSING DROP PRIMARY KEY;
ALTER TABLE DMS.PT_MONTHLYCLOSING ADD CONSTRAINT PK_FLOWNO PRIMARY KEY(FLOWNO);