----声明包头 create or replace package pack_0831_a is function fun_0831_a(a number,b number) return number; d number;
procedure pro_0831_a(a number,b number); v number; end;
-----声明包身 create or replace package body pack_0831_a is function fun_0831_a(a number, b number) return number is d number; begin d := a + b; return d; end; procedure pro_0831_a(a number, b number) is v number; begin v := a * b; dbms_output.put_line(v); end; end;
----调用 select pack_0831_a.fun_0831_a(12,12) from dual; call pack_0831_a.pro_0831_a(12,12);
select fun_0831_a(12,12) from dual;--没有写包的前缀,找不到此函数
declare e number; begin e := pack_0831_a.fun_0831_a(12,12); dbms_output.put_line(e); pack_0831_a.pro_0831_a(12,12); end;