aiaiDBA

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

13718043309

010-86462881

ORA-01002: fetch out of sequence

ORA-01002: fetch out of sequence
Cause: This error means that a fetch has been attempted from a cursor which is no longer valid. Note that a PL/SQL cursor loop implicitly does fetches, and thus may also cause this error. There are a number of possible causes for this error, including: 1) Fetching from a cursor after the last row has been retrieved and the ORA-1403 error returned. 2) If the cursor has been opened with the FOR UPDATE clause, fetching after a COMMIT has been issued will return the error. 3) Rebinding any placeholders in the SQL statement, then issuing a fetch before reexecuting the statement.
Action: 1) Do not issue a fetch statement after the last row has been retrieved - there are no more rows to fetch. 2) Do not issue a COMMIT inside a fetch loop for a cursor that has been opened FOR UPDATE. 3) Reexecute the statement after rebinding, then attempt to fetch again.

请先 登录 后评论

1 个回答

小智
ORA-01002:取出序列,
.原因:此错误表示已从不再有效的游标尝试提取。请注意,PL / SQL游标循环隐式地执行提取,因此也可能导致此错误。此错误有多种可能的原因,包括:1)在检索到最后一行之后从游标中获取并返回ORA-1403错误。2)如果已使用FOR UPDATE子句打开游标,则在发出COMMIT之后获取将返回错误。3)在SQL语句中重新绑定任何占位符,然后在重新执行语句之前发出提取。,
.操作: 1)在检索到最后一行之后,不要发出fetch语句 - 没有更多的行要提取。2)不要在已打开FOR UPDATE的游标的提取循环中发出COMMIT。3)重新绑定后重新执行语句,然后尝试再次提取。,
.
请先 登录 后评论