用完后关闭游标
CLOSE rst;

解决方案 »

  1.   

    用完后关闭游标
    CLOSE rst;
      

  2.   


     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 ?
      

  3.   

    什么时候close呢?
    这样就超过最大打开游标数了
      

  4.   

    Where to call and get it ?
    When used, close it!
      

  5.   

    什么时候close呢?
    这样就超过最大打开游标数了
      

  6.   

    什么时候close呢?
    这样就超过最大打开游标数了
      

  7.   

    TO  bzszp(SongZip): 求助!正在做的应用,
    客户端调用后台函数,返回结果集, 但是连续执行超过 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 不能工作。 为什么, 该如何去做? 比较急的 !
      

  8.   


     I only use close connection  and  repeat open  the connection   ! so solwly , but still work as before
      

  9.   

    declare
      rst  pk_test.t_cur;
    begin
      rst := pk_test.fn_getresult;
      
       ...  close rst ;
    end;
      

  10.   

    如果要返回记录集,我觉得使用pl/sql表应该很不错吧
      

  11.   

    在写一个过程,用来在必要时关闭CURSORS
    procedure p_CLOSE(
    p_dd in out t_cur)
    is
    begin
      IF P_DD%ISOPEN THEN
        CLOSE p_dd;
      END IF;
    end;