📅  最后修改于: 2022-03-11 15:05:16.329000             🧑  作者: Mango
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;