函数和过程不同的是:函数的返回值必须有返回的对象,比如下面的写法都是合法的: delcare a number(10); begin a := pack_lly_test.fun_b(1.0); end; --------------------------------- begin debug.print to_char(pack_lly_test.fun_b(1.0)); end; --------------------------------- begin if pack_lly_test.fun_b(1.0) > 1 then ... end if; end;
delcare
a number(10);
begin
a := pack_lly_test.fun_b(1.0);
end;
---------------------------------
begin
debug.print to_char(pack_lly_test.fun_b(1.0));
end;
---------------------------------
begin
if pack_lly_test.fun_b(1.0) > 1 then
...
end if;
end;
exec dbms_output.put_line(pack_lly_test.fun_b(1.0));
SQL > exec dbms_output.put_line(pack_lly_test.fun_b(1.0));
PL/SQL 过程已成功完成,但没有显示结果。 我想把结果显示出来,用什么办法呢?
SQL> declare a number :=0;
2 a := pack_lly_test.fun_b(1.0);
3 .......
下一步怎么做呢?
SET SERVEROUTPUT ON