读书人

游标FETCH出错(sqlcode=420)游标自动

发布时间: 2012-06-04 14:48:03 作者: rapoo

求助:游标FETCH出错(sqlcode=420)游标自动关闭
游标在fetch的时候出错,sqlcode=420,然后进行错误处理的时候去关闭游标报出501的错误。

是游标fetch的时候出错,游标会自动关闭吗?还是出现一些固定的错误的时候游标才会自动关闭(比如sqlcode=420的错误)。


[解决办法]
mark 学习一下 同求高手~~~~
[解决办法]
SQL0501N The cursor specified in a FETCH or CLOSE statement is not
open.

Explanation:

The program attempted to either: (1) FETCH using a cursor, or (2) CLOSE
a cursor at a time when the specified cursor was not open.

The statement cannot be processed.

User response:

Check for a previous message (SQLCODE) that may have closed the cursor.
Note that after the cursor is closed, any fetches or close cursor
statements receive SQLCODE -501.

If no previous SQLCODEs have been issued, correct the application
program to ensure that the cursor is open when the FETCH or CLOSE
statement is executed.

读书人网 >IBM DB2

热点推荐