我在pl/sql developer编写了如下的存储过程,编译显示成功,为什么没能看到结果?
create or replace procedure practice as
v_total number(5);
v_count number(5);
begin
  loop
      v_total:=v_total+v_count**2;
  exit when v_count=15;
  v_count:=v_count+2;
  end loop;
  dbms_output.put_line(v_total);   
end practice;

解决方案 »

  1.   

    要在output窗口才能看到dbms_output.put_line的输出值。
      

  2.   

    写错了 set serveroutput on
      

  3.   

    请问output的窗口怎么搞出来?
      

  4.   

    command 下
    set serveroutput on
      

  5.   

    不好意思,我刚用这个,请问怎么command啊,我的代码写成这样可以么?
    set serveroutput on
    delcare
    create or replace procedure practice as
    v_total number(5);
    v_count number(5);
    begin
      loop
          v_total:=v_total+v_count**2;
      exit when v_count=15;
      v_count:=v_count+2;
      end loop;
      dbms_output.put_line(v_total);   
    end practice;
      

  6.   

    v_total number(5); 
    v_count number(5);
    是存储过程参数吗,如果是,应该指定In 或者OUT;
    如果是变量,最好设定初始值,如0;
    否则Null加别的值还是Null