oracle drop index if exists

前端 未结 5 1671
渐次进展
渐次进展 2020-12-28 13:53

How do you drop an index only if it exists?

It seems simple but I did found anything on the net. The idea is to drop it only if it exists, because if not, I will hav

5条回答
  •  孤独总比滥情好
    2020-12-28 14:15

    I hope this will help. It's a combination of all solution :) By the way thanks for the help !

    CREATE OR REPLACE PROCEDURE CLEAR_INDEX(INDEX_NAME IN VARCHAR2) AS
    BEGIN
        EXECUTE IMMEDIATE 'drop index ' || INDEX_NAME;
    EXCEPTION
        WHEN OTHERS THEN
            NULL;
    END CLEAR_INDEX;
    

提交回复
热议问题