📜  oracle 删除序列 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:50.856000             🧑  作者: Mango

代码示例2
DECLARE
    s_exist NUMBER(1);
BEGIN
    SELECT CASE WHEN exists(SELECT * FROM ALL_SEQUENCES 
                           WHERE SEQUENCE_NAME = 'seq_name') THEN 1
           ELSE 0 
    END INTO s_exist FROM DUAL;
    IF s_exist = 1 THEN
        EXECUTE IMMEDIATE 'DROP SEQUENCE seq_name';
    END IF;
END;