aiaiDBA

加微信获取免费职业规划+学习资料,了解年薪50万的DBA是如何练成的

13718043309

010-86462881

SQL-02118: Invalid row for a WHERE CURRENT OF operation

SQL-02118: Invalid row for a WHERE CURRENT OF operation
Cause: An attempt was made to reference a nonexistent row using the CURRENT OF clause in an UPDATE or DELETE statement. This happens when no FETCH has been executed or when FETCH returns a "no data found" error that the program fails to trap.
Action: Check that the last cursor operation succeeded and that the current row of the cursor is valid. The outcome of a cursor operation can be checked in two ways: implicit checking with the WHENEVER statement or explicit checking of SQLCODE in the SQLCA.

请先 登录 后评论

1 个回答

小智
SQL-02118:WHERE CURRENT OF操作的行无效,
.原因:尝试在UPDATE或DELETE语句中使用CURRENT OF子句引用不存在的行。当没有执行FETCH或FETCH返回程序无法陷阱的“无数据发现”错误时,会发生这种情况。,
.操作:检查最后一个光标操作是否成功,光标的当前行是否有效。可以通过两种方式检查游标操作的结果:使用WHENEVER语句进行隐式检查或在SQLCA中显式检查SQLCODE。,
.
请先 登录 后评论