欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Oracle删除用户下的sequence

程序员文章站 2022-07-14 20:03:13
...

--Oracle删除用户下的sequence

 declare owner_name varchar(20);  
    cursor cur1 is select sequence_name from user_sequences;  
    begin  
        owner_name := '用户名';   
        for cur2 in cur1 loop  
            execute immediate 'drop sequence '||owner_name||'.'||cur2.sequence_name;  
        end loop;  
    end;