oracle游标报错“超出范围”
关注:111 答案:2 手机版
解决时间 2021-03-01 21:37
提问者断念劫难
2021-03-01 09:37
BEGIN DECLARE dummy integer; BEGIN select 1 into dummy from dual where exists (select 1 from all_synonyms where owner = 'PUBLIC' and synonym_name = 'DBMS_WM'); EXCEPTION when NO_DATA_FOUND then RAISE_APPLICATION_ERROR(-20000, 'OWM Not Installed'); END; IF (sys.ltadm.existnonliveworkspaces OR sys.ltadm.existversionedtabs) THEN SYS.WM_ERROR.RAISEERROR(SYS.LT.WM_ERROR_189_NO); ELSE begin delete from wmsys.wm$workspaces_table; exception when others then null; end; begin delete from wmsys.wm$workspace_priv_table; exception when others then null; end; begin delete from wmsys.wm$version_hierarchy_table ; exception when others then null; end; begin execute immediate 'drop sequence wmsys.wm$up_del_trig_name_sequence' ; exception when others then null; end; begin execute immediate 'drop sequence wmsys.wm$insteadof_trigs_sequence' ; exception when others then null; end; begin execute immediate 'drop sequence wmsys.wm$lock_sequence' ; exception when others then null; end; begin execute immediate 'drop sequence wmsys.wm$vtid' ; exception when others then null; end; begin execute immediate 'drop sequence wmsys.wm$adt_sequence' ; exception when others then null; end; begin execute immediate 'drop sequence wmsys.wm$version_sequence' ; exception when others then null; end; begin execute immediate 'drop sequence wmsys.wm$row_sync_id_sequence' ; exception when others then null; end; begin execute immediate 'drop sequence wmsys.wm$udtrig_dispatcher_sequence' ; exception when others then null; end; execute immediate 'create sequence wmsys.wm$up_del_trig_name_sequence start with 4 nocache'; execute immediate 'create sequence wmsys.wm$insteadof_trigs_sequence start with 4 nocache'; execute immediate 'create sequence wmsys.wm$lock_sequence start with 8 incr ement by 2 nocache'; execute immediate 'create sequence wmsys.wm$vtid start with 4 nocache'; execute immediate 'create sequence wmsys.wm$adt_sequence start with 4 nocac he'; execute immediate 'create sequence wmsys.wm$version_sequence start with 4 n ocache'; execute immediate 'create sequence wmsys.wm$row_sync_id_sequence start with 14 nocache'; execute immediate 'create sequence wmsys.wm$udtrig_dispatcher_sequence star t with 4 nocache'; END IF ; COMMIT; END;我游标数值范围设置到1000了,请问这是什么问题?要怎么解决?
最佳答案
二级知识专家我有我风格
2021-03-01 11:05
oracle的变量,游标定义,都是在begin前
oracle里没有deallocate splitCur;
。。。很多问题
全部回答
1楼你哪知我潦倒为你
2021-03-01 12:20
不是这样的,存储过程中不是非要用游标啊,他有输入和输出参数,只要在过程中做相应的处理就会返回输出参数。游标的作用主要是为了循环提取数据,游标分隐性游标和显性游标。
举个例子(显性游标):
cursor 游标名 is select 语句;
.....
while 游标名% found loop
.....
end loop;
其中的select 语句提取的是一列值,然后每次取一个进行下面的循环。
(隐性游标):
for 游标名 in (select 语句)loop
.....
.....
end loop;
其中的select 语句提取的也是一列值,然后每次取一个进行下面的循环。
我要举报
如以上信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
推荐资讯
大家都在看