use*_*452 5 plsql implicit cursor
使用PL/SQL会出现一种情况,例如在异常的情况下,隐式游标将无法关闭?
我知道隐式游标应该在使用后自行关闭,但只是想知道是否存在可能不是这种情况的情况,如果这是可能的,那么什么样的补救将是一个好主意.
失败时COMMIT or ROLLBACK游标不会自动关闭
建议使用游标时使用以下路线:
-- before using the cursor
IF your_cursor %ISOPEN THEN
CLOSE your_cursor;
END IF;
OPEN your_cursor;
-- after using the cursor
CLOSE your_cursor;
-- when exception
IF your_cursor %ISOPEN THEN
CLOSE your_cursor;
END IF;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2513 次 |
| 最近记录: |