create or replace package p_users is
--函数/过程
function dataformat(v_time in date) return varchar2;
procedure updateusers(v_id in number,v_name in varchar2);
end p_users;
--包的主题
create or replace package body p_users is
begin
function dataformat(v_time in date) return varchar2
is
v_chartime varchar2;
begin
v_chartime:=to_char(v_time,'YYYY-MM-DD HH24:MI:SS');
return v_chartime;
end dataformat;
procedure updateusers(v_id in number,v_name in varchar2)
is
begin
update users u set u.name=u_name where u.id=v_id;
commit;
end updateusers;
end p_users;
先运行create or replace package
再运行create or replace package body
或
在多句之间加一行 /