qq_23916211
qq_23916211
2018-12-12 02:49

游标报错,技术大咖帮忙看看

  • cursor

create or replace procedure seq_name(v_seq out number) is
cursor c_seq_name is select sequence_name from dba_sequences where sequence_name = 'CMS';
v_seq_name c_seq_name%rowtype;
begin
open c_seq_name;
loop
fetch c_seq_name into v_seq_name;
if c_seq_name%notfound then
execute immediate 'alter sequence'||v_seq_name||'nocache nocycle';
execute immediate 'alter sequence'||v_seq_name||'increment by -'||v_seq_name.nextval||'minvalue 0 maxvalue 999999999';
v_seq:=v_seq_name.nextval;
execute immediate 'alter sequence'||v_seq_name||'increment by 1 cache 20 cycle';
v_seq :=v_seq_name.nextval ;
else
exit;
end if;
end loop;
close c_seq_name;
end;
这是序列重置,我单个写没问题,循环取出来就报错,哪个大神帮忙看看呐

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答