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;
时间: 2024-11-05 16:36:52