SET SERVEROUTPUT ON/OFF
你的环境是 ON 还是 OFF

解决方案 »

  1.   

    直接在SQL PLUS中写:
    SQL>SET SERVEROUTPUT ON
    意思是让输出能显示在屏幕上,Oracle默认是OFF
    另外,查看所的的环境可以用
    SQL>SHOW ALL
      

  2.   

    SQL> SET SERVEROUTPUT ON
    SQL> declare
      2    w_rc       pkg_test.myrctype; --定义ref cursor型变量
      3    --定义临时变量,用于显示结果
      4    w_stcd     wq_stinfo_b.stcd%type;
      5    w_STNM     wq_stinfo_b.STNM%type;
      6    w_STLVL    wq_stinfo_b.STLVL%type;
      7    w_BNNM     wq_stinfo_b.BNNM%type;
      8    w_SUBNM    wq_stinfo_b.SUBNM%type;
      9    w_RVNM     wq_stinfo_b.RVNM%type;
     10  
     11  begin
     12    --调用函数,获得记录集
     13     pkg_test.get('308A5611',w_rc);
     14     --STCD, STNM, STLVL, BNNM, SUBNM, RVNM
     15    --fetch结果并显示
     16   loop
     17   fetch w_rc into w_stcd,w_STNM,w_STLVL,w_BNNM,w_SUBNM,w_RVNM;
     18   exit when w_rc%notfound;
     19   dbms_output.put_line(w_STNM);
     20   end loop;
     21  end;
     22  
     23  
     24  
     25  我这么写的,怎么什么都没反映???
      

  3.   

    这好像就从这里跳出了。
       exit when w_rc%notfound;
      

  4.   

    单独运行:pkg_test.get('308A5611',w_rc);
    有一条记录啊!!我测试了!!
      

  5.   


    dbms_output.put_line(w_STNM);是不是这个有问题啊??
    我想输出一条记录出去...
    好象报数据溢出了!!!