For 循环变量具有 NULL 值
我有这个变量声明
counter INTEGER := 0; /* loop counter */
然后有一个 for 循环,就像
FOR counter IN 1 .. CEIL(records / batch)
LOOP
执行点一到这里它就会抛出异常。
ORA-01086: savepoint 'SP1' never established in this session or is invalid
ORA-06512: at "MALI521.PRVSAPUPD", line 421
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 8
现在,SP1 保存点已在 for 循环中建立。代码在进入 for 循环时失败,因为那里的计数器变量具有 NULL 值。
有什么想法吗?
请删除它。我想通了。
I have this variable declaration
counter INTEGER := 0; /* loop counter */
And then there is for loop like
FOR counter IN 1 .. CEIL(records / batch)
LOOP
No sooner the execution point comes here it throws execption.
ORA-01086: savepoint 'SP1' never established in this session or is invalid
ORA-06512: at "MALI521.PRVSAPUPD", line 421
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 8
Now the SP1 savepoint is established in the for loop. The code is failing the moment it comes at for loop, since the counter variable there has NULL value.
Any idea?
PLEASE DELETE IT. I FIGURED IT OUT.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确定
counter
是问题所在吗?records
和batch
的值是多少Are you sure
counter
is the problem? what are the value ofrecords
andbatch