帮忙看看这个存储过程是什么错误

nancliu nancliu 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
create or replace procedure seq_update()
as
str_sql varchar2(500);
CurrValue integer;
LastValue integer;
BEGIN
str_sql:='select last_number-FLOOR(last_number/1000)*1000 INTO CurrValue from user_sequences
where sequence_name=''SEQ_AUTH'';
execute immediate str_sql;
str_sql:='DROP SEQUENCE SEQ_AUTH';
execute immediate str_sql;
str_sql:='CREATE SEQUENCE SEQ_AUTH MINVALUE 101 MAXVALUE 199 START WITH 101 INCREMENT BY 1 NOCACHE';
execute immediate str_sql;
alter sequence SEQ_AUTH increment by -1 nocache;
select SEQ_AUTH.nextval from dual;
alter sequence SEQ_AUTH increment by 1 nocache;
loop
select SEQ_AUTH.currval into LastValue from dual;
exit when LastValue >= CurrValue;
select SEQ_AUTH.nextval into LastValue from dual;
end loop;


alter sequence SEQ_AUTH increment by 1 nocache;
SELECT LAST_NUMBER from user_sequences where sequence_name='SEQ_AUTH'
end;
------错误如下
Text: procedure seq_update()
#13#10Error: PLS-00103: 出现符号 "DROP"在需要下列之一时:
. ( * @ % & = - + ; < / >
at in is mod not rem <an exponent (**)> <> or != or ~= >= <=
<> and or like between ||
Line: 10
Text: str_sql:='DROP SEQUENCE SEQ_AUTH';
这个存储过程的功能是从修改序列,并改变序列的当前值
...全文
评论 8
收藏 已收藏
分享
返回顶部
nancliu
Oracle 17,133 成员 55,258 内容