创建存储过程如下
set serveroutput on
create or replace procedure print as
begin  
  dbms_output.put_line('abc');
end;调用存储过程如下
SQL> set serverout on
SQL> call print();Method called问题:
为什么不显示abc?

解决方案 »

  1.   

    16:27:43 scott@TUNGKONG> set serveroutput on
    16:27:53 scott@TUNGKONG> create or replace procedure print as
    16:27:58   2  begin
    16:27:58   3    dbms_output.put_line('abc');
    16:27:58   4  end;
    16:27:58   5  /过程已创建。已用时间:  00: 00: 00.14
    16:28:00 scott@TUNGKONG> call print();
    abc调用完成。
    .................
      

  2.   


    SQL> conn sys/admin as sysdba
    已连接。
    SQL> create or replace procedure print as
      2  begin
      3    dbms_output.put_line('abc');
      4  end;
      5  /过程已创建。SQL> set serverout on;
    SQL> call print();
    abc调用完成。这个表情好玩..
      

  3.   

    试试执行一下 set termout on 这个命令啊不知道管不管用
      

  4.   

    楼主你没错,想问一下,lz你是在哪里执行的这个call print();
      

  5.   

    SQL> set serveroutput on
    SQL> create or replace procedure print as
      2  begin
      3    dbms_output.put_line('abc');
      4  end;
      5  /Procedure createdSQL> exec print;
    abcPL/SQL procedure successfully completedSQL> call print();Method called
      

  6.   

    估计是oracle的版本问题吧,9i里面call命令调用procedure不出结果,不过exec是没问题的
      

  7.   

    set serveroutput on 
    楼主在创建procedure时候明明写的是正确的
    可在SQL*PLUS中运行的时候怎么就写错了呢
    呵呵
    写成了set serverout on 了
      

  8.   

    之前是在SQLPLUS中的command window中调用的,调用结果如下:
    SQL> set serverout on
    SQL> exec print();
    abcPL/SQL procedure successfully completedSQL> call print();Method called
    可见只有exec命令有用在SQL*PLUS中执行,结果如下:SQL> set serverout on
    SQL> call print();
    abc调用完成。SQL> exec print();
    abcPL/SQL 过程已成功完成。两个都好用再次谢谢各位的帮忙!!