或者找高版本的PL/SQL DEVELOPER可以跟储存过程,能得到游标的内容~~

解决方案 »

  1.   

    dbms_output.putline()也可以吗?
    具体怎么操作呀,就这样加上去不对啊~
      

  2.   

    SQL> declare
      2  i_str varchar2(10):='';
      3  num number;
      4  begin
      5  select count(*) into num from dept where deptno=nvl(i_str,deptno);
      6  dbms_output.put_line(num);
      7  end;
      8  /
    4PL/SQL 过程已成功完成。
      

  3.   

    CREATE OR REPLACE PROCEDURE Department_SelectAll
    (P_CURSOR in out department_pkg.Tab_departmentcousor)
    IS
    BEGIN
    if P_CURSOR%isopen then
       close P_CURSOR;
    end if;
    open P_CURSOR  for 
    select * from department;
    dbms_output('游标已成功打开');
    END Department_SelectAll;
    /在testwindow中输入
    declare 
      -- Local variables here
      i integer;
      myc1 department_pkg.Tab_departmentcousor;
    begin
      -- Test statements here
      Department_SelectAll(myc1);
    end;
    执行后,在testwindow的dbms output栏里显示"游标已成功打开"
      

  4.   

    游标几种常用状态:
    P_CURSOR%isopen   boolean类型,真为正在打开,假为未打开,打开处于该状态的游标会出错;
    P_CURSOR%found    boolean类型,真为有数据,假为没有数据,一般紧跟在fetch语句后面
    P_CURSOR%notfound boolean类型,用法与前者相反;
    dbms_output.put_line()的用法:
    参数可以是日期/字符/数值,长度好象不能大于1024,作用是输出参数内容到缓冲区或测试窗口的dbms output栏