DB2 删除列 查询列

ORACLE:
ALTER TABLE SCHEMA.TABLE_NAME DROP COLUMN COLUMN_NAME

DB2:
ALTER TABLE SCHEMA.TABLE_NAME DATA CAPTURE NONE @

ALTER TABLE SCHEMA.TABLE_NAME DROP COLUMN COLUMN_NAME @

REORG TABLE SCHEMA.TABLE_NAME ALLOW READ ACCESS@
REORG INDEXES ALL FOR TABLE SCHEMA.TABLE_NAME ALLOW WRITE ACCESS CLEANUP ONLY PAGES @

ALTER TABLE SCHEMA.TABLE_NAME DATA CAPTURE CHANGES @

查询列
SELECT * FROM SYSIBM.COLUMNS WHERE TABLE_SCHEMA = 'SCHEMA' AND TABLE_NAME = 'TABLE_NAME' AND COLUMN_NAME = 'COLUMN' ;


你可能感兴趣的:(oracle,db2)