Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle drop sequence if exists

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;
Comment

PREVIOUS NEXT
Code Example
Sql :: sql now 
Sql :: oracle drop job if exists 
Sql :: mysql get all tables from a specific database 
Sql :: wherein sql 
Sql :: mysql backup database 
Sql :: snowflake drop column 
Sql :: mysql grant select update insert delete 
Sql :: creating index in mysql 
Sql :: sql server add time to date 
Sql :: add multiple row table pl sql 
Sql :: postgres update multiple columns 
Sql :: date in oracle 
Sql :: SQL Server Altering Column to be Unique 
Sql :: oracle sql copy table without data 
Sql :: division by zero postgres 
Sql :: opening xampp mysql in cmd ubuntu 
Sql :: postgres top 10 
Sql :: calculate percentage in sql 
Sql :: WHERE not regex in SQL 
Sql :: sql find table by name 
Sql :: postgres week number 
Sql :: remove all data from table mysql 
Sql :: t_sql contains 
Sql :: alter table add foreign key mariadb example 
Sql :: mariadb cast to int 
Sql :: insert into auto increment mysql 
Sql :: mysql default value 
Sql :: delete from IN subquery 
Sql :: sql server port 
Sql :: drop all triggers oracle 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =