码迷,mamicode.com
首页 > 数据库 > 详细

oracle 序列初始化的plsql块脚本

时间:2015-10-22 12:25:16      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:

declare
seq_name dba_sequences.SEQUENCE_NAME%TYPE;
cursor mycur is
select * from dba_sequences where sequence_owner=‘NETHRA‘;
query_row dba_sequences%rowtype;
begin
open mycur; --打开游标
loop
fetch mycur into query_row; --把游标所指的纪录放到变量中
exit when (mycur%notfound); --当游标没有指向行时退出循环
DBMS_OUTPUT.put_line(‘SEQ有:‘ || query_row.SEQUENCE_NAME || ‘条记录‘);
--execute immediate ‘drop sequence ‘||query_row.SEQUENCE_NAME;
--execute immediate ‘create sequence ‘||query_row.SEQUENCE_NAME||‘ minvalue 1 maxvalue 999999999999999999999999999 start with 1 increment by 1 nocache‘;
end loop;
close mycur;
end;

oracle 序列初始化的plsql块脚本

标签:

原文地址:http://www.cnblogs.com/kexb/p/4900133.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!