create or replace package mytest is  -- Author : ADMINISTRATOR  -- Created : 2008-5-13 11:19:28  -- Purpose : test  TYPE record_type IS RECORD(  code   VARCHAR2(18),  p_name VARCHAR2(16));  TYPE ref_cur_type IS REF CURSOR;  end mytest;===========================请问一下 这个。 TYPE ref_cur_type IS REF CURSOR;是干嘛的》????

解决方案 »

  1.   

    动态cursor.建议直接使用sys_refcursor.
      

  2.   

    定义类型ref_cur_type 为动态游标类型,动态游标类型是直到查询的时候才知道这条查询
      

  3.   


    定义一个类型名称为ref_cur_type 的动态游标
    参考动态游标
      

  4.   

    重新给你ref_cursor的学习材料,以前我用的
    http://blog.csdn.net/qfs_v/archive/2008/05/06/2404794.aspx
    http://blog.csdn.net/lzzyok/archive/2008/04/24/2324566.aspx
      

  5.   


    --type ref_cur_type is ref cursor 就是定义一个动态游标;
    /*看了下面的代码就很清楚了*/
    declare 
    type ref_cur_type is ref cursor;
    ref_cur ref_cur_type;
    re_test test%rowtype;
    begin
    open ref_cur for select * from test;
    loop
     fetch ref_cur into re_test ;
     exit when ref_cur%notfound;
     dbms_output.put_line(re_test.name);
     end loop;
     close ref_cur;
     end;