我在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;
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;
set serveroutput on
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;
v_count number(5);
是存储过程参数吗,如果是,应该指定In 或者OUT;
如果是变量,最好设定初始值,如0;
否则Null加别的值还是Null