游标Cursor语句
游标Cursor语句用于记录数据库执行游标的完整过程:定义、打开、Fetch、关闭。
//PrepareStatement语句
---1 1 SYSDBA 5 127.0.0.1 2020-04-11 13:21:46---Prepare st143bc6e85 as SELECT IDX.*,TAB.TABLE_NAME FROM all_INDEXES IDX LEFT JOIN all_TABLES TAB ON IDX.TABLE_ID=TAB.TABLE_ID WHERE IDX.DB_ID=1 AND IDX.TABLE_ID=1048578
//使用游标方式获取PrepareStatement结果集
---1 1 SYSDBA 5 127.0.0.1 2020-04-11 13:21:46 declare cur5 cursor for st143bc6e85
//打开游标
---1 1 SYSDBA 5 127.0.0.1 2020-04-11 13:21:46 open cur5
//从游标中获取1000条数据
---1 1 SYSDBA 5 127.0.0.1 2020-04-11 13:21:46 fetch 1000 from cur5
//关闭游标
---1 1 SYSDBA 5 127.0.0.1 2020-04-11 13:21:46 close cur5
//关闭PrepareStatement
---1 1 SYSDBA 5 127.0.0.1 2020-04-11 13:21:46 deallocate st143bc6e85