用完后关闭游标
CLOSE rst;
CLOSE rst;
解决方案 »
- 判断数据
- 如何用sql语句在oralce中实现递归查询
- 在xp下安装oracle 11g,完成之后发现没有企业管理器
- oracle 中xml问题
- 项目需要,我需要从oracle9i中批导出文本格式数据,各位大侠有好办法没有?(急)
- 只要你做了,就有分了,谢谢大家帮忙了
- 数据量大的系统就用反模式去设计,合理吗?
- 在线等待求教,oracle9.2.0.1安装问题
- 为什么有的进程杀不死?
- 导ACCESS表入ORACLE时,ODBC--调用失败,[Oracle][odbc][Ora]0(#1401),该怎么办?(回复都有分)
- 如何从ORACLE中倒出非缺省的XML文件
- 请问怎么把单引号插入到oracle数据库中?
CLOSE rst;
the rst will be return , you know , It is a function and return a record result , I close the rst before it open ,
the following code is How to do it , but never work ,
eg;
create package pk_test as
t_cur is ref cursor;
function fn_GetResult return t_cur;
end pk_test;
/
create package body pk_test as
function fn_GetResult return t_cur
is
rs t_cur;
sqlview varchar2(1000);
rst t_cur ;
begin
sqlview := 'select * from table ';
if not rst%isopen then
open rst for sqlview;
end if;
return rst;
end fn_GetResult;end pk_test ;
/this package will be repeat call by client application ,
when it execute more than 1000 will taken ORA-01000: maximum open cursors exceeded
why ?
这样就超过最大打开游标数了
When used, close it!
这样就超过最大打开游标数了
这样就超过最大打开游标数了
客户端调用后台函数,返回结果集, 但是连续执行超过 80多次后
报 ORA-01000: maximum open cursors exceeded 错误下面是我的代码:create package pk_test as
t_cur is ref cursor;
function fn_GetResult return t_cur;
end pk_test;
/
create package body pk_test as
function fn_GetResult return t_cur
is
rs t_cur;
sqlview varchar2(1000);
rst t_cur ;
begin
sqlview := 'select * from table ';
if rst%isopen then
close rst; /* 因为要返回结果集, 所以不能在 return 之前关闭*/
end if;
return rst;
end fn_GetResult;end pk_test ;
但是 CLOSE 不能工作。 为什么, 该如何去做? 比较急的 !
I only use close connection and repeat open the connection ! so solwly , but still work as before
rst pk_test.t_cur;
begin
rst := pk_test.fn_getresult;
... close rst ;
end;
procedure p_CLOSE(
p_dd in out t_cur)
is
begin
IF P_DD%ISOPEN THEN
CLOSE p_dd;
END IF;
end;