1DECLARE
2 s_exist NUMBER(1);
3BEGIN
4 SELECT CASE WHEN exists(SELECT * FROM ALL_SEQUENCES
5 WHERE SEQUENCE_NAME = 'seq_name') THEN 1
6 ELSE 0
7 END INTO s_exist FROM DUAL;
8 IF s_exist = 1 THEN
9 EXECUTE IMMEDIATE 'DROP SEQUENCE seq_name';
10 END IF;
11END;