/** * 建索引 */ DECLARE AN_FLAG NUMBER; BEGIN SELECT COUNT(1) INTO AN_FLAG FROM USER_IND_COLUMNS WHERE TABLE_NAME = 'T_ZZ_RELEASED_RECORD' AND COLUMN_NAME = 'RR_ID'; IF AN_FLAG = 0 THEN EXECUTE IMMEDIATE 'CREATE INDEX IDX$RR_ID ON T_ZZ_RELEASED_RECORD(RR_ID)'; COMMIT; END IF; END; /原文链接:https://www.f2er.com/oracle/209629.html