Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

oracle drop sequence

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;
 
PREVIOUS NEXT
Tagged: #oracle #drop #sequence
ADD COMMENT
Topic
Name
7+1 =