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

解决方案 »

  1.   

    Why not use pl/sql table?
      

  2.   

    Why not use pl/sql table?
      

  3.   

    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 ;
    在写一个过程,用来在必要时关闭CURSORS
      

  4.   

    procedure p_CLOSE(
    p_dd in out t_cur)
    is
    begin
      IF P_DD%ISOPEN THEN
        CLOSE p_dd;
      END IF;
    end;