帮忙看看这个存储过程是什么错误
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';
这个存储过程的功能是从修改序列,并改变序列的当前值
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';
这个存储过程的功能是从修改序列,并改变序列的当前值
...全文
相关推荐
oracle存储过程编译错误问题
NULL 博文链接:https://forlab.iteye.com/blog/1821751
mysql存储过程之错误处理实例详解
主要介绍了mysql存储过程之错误处理,结合实例形式详细分析了mysql存储过程错误处理相关原理、操作技巧与注意事项,需要的朋友可以参考下
MySQL存储过程相互调用并获得错误码示例
代码如下: mysql> mysql> delimiter $$ mysql> mysql> CREATE PROCEDURE myProc() -> MODIFIES SQL DATA -> BEGIN -> DECLARE l_status VARCHAR(20); -> -> CALL myProc1(l_status); -> IF l_status=’Duplicate Entry’ THEN -> SELECT CONCAT(‘Warning: using existing definition for location ‘) AS warning; -> END IF; -> E
DB2数据库创建存储过程时遇到的错误
本文将为大家介绍了DB2数据库创建存储过程时遇到的错误。
[MySQL] 存储过程错误异常处理例子
-- DECLARE EXIT HANDLER FOR SQLEXCEPTION


