首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > IBM DB2 >

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

2012-06-04 
求助:游标FETCH出错(sqlcode420)游标自动关闭游标在fetch的时候出错,sqlcode420,然后进行错误处理的时候

求助:游标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.

热点排行