[sql]代码库
1、修改列名
ALTER TABLE TEMPUPCDATA.EXTERNAL_USER_INFO RENAME COLUMN ID TO CUSTOMER_CODE;
2、删除CONSTRAINT
ALTER TABLE TEMPUPCDATA.EXTERNAL_USER_AGENT_BROKER DROP CONSTRAINT CK_EUAB_AGENT_BROKER_TYPE;
3、删除SYNONYM
DROP PUBLIC SYNONYM 【SYNONYM名】
4、删除SEQUENCE
DROP SEQUENCE SEQ_EXTERNAL_USER_INFO_ID
5、修改列注释
COMMENT ON COLUMN TABLE_NAME.COLUMN_NAME IS 'CHANGEDCOMMENT';
6、删除表数据
DELETE TEMPUPCDATA.EXTERNAL_USER_INFO;
7、删除列
ALTER TABLE TEMPUPCDATA.EXTERNAL_USER_INFO DROP COLUMN VALID;
8、增加列
ALTER TABLE TABLENAME ADD COLUMN_NAME DATATYPE;
COMMENT ON COLUMN TABLE_NAME.COLUMN_NAME IS 'CHANGEDCOMMENT';
9、修改列类型
ALTER TABLE TABLENAME MODIFY FILEDNAME VARCHAR2(20);
10、删除表
DROP TABLE TABLENAME
11、删除索引
DROP INDEX INDEXNAME
12、建唯一约束
CREATE UNIQUE INDEX EPCISASSDATA.PK_SUB_CONFER_APPLY_EXTEND ON EPCISASSDATA.SUB_CONFER_APPLY_EXTEND
(CONFER_APPLY_NO, SUB_CONFER_SEQ);
13、创建索引
CREATE INDEX TEMPUPCDATA.IDX_UNDR_INFO_DEPT_CODE ON TEMPUPCDATA.UNDERWRITE_INFO(DEPARTMENT_CODE, SEND_TIME) INITRANS 16;