2个回答
展开全部
以scott用户下的emp表为列:
创建TT包:
create or replace package TT
as
procedure p_insert(empno emp.empno%type,ename emp.ename%type);
procedure p_delete(vempno emp.empno%type);
procedure p_update(vempno emp.empno%type,vename emp.ename%type);
end TT;
创建包体:
create or replace package body TT
as
procedure p_insert(empno emp.empno%type,ename emp.ename%type)
as
begin
insert into emp(empno,ename) values(empno,ename);
end p_insert;
procedure p_delete(vempno emp.empno%type)
as
begin
delete from emp where empno=vempno;
end p_delete;
procedure p_update(vempno emp.empno%type,vename emp.ename%type)
as
begin
update emp set ename=vename where empno=vempno;
end p_update;
end TT;
调用相应的过程:
execute tt.p_insert(8888,'ALSANTE');
execute tt.p_delete(8888);
execute tt.p_update(8888,'MING');
创建TT包:
create or replace package TT
as
procedure p_insert(empno emp.empno%type,ename emp.ename%type);
procedure p_delete(vempno emp.empno%type);
procedure p_update(vempno emp.empno%type,vename emp.ename%type);
end TT;
创建包体:
create or replace package body TT
as
procedure p_insert(empno emp.empno%type,ename emp.ename%type)
as
begin
insert into emp(empno,ename) values(empno,ename);
end p_insert;
procedure p_delete(vempno emp.empno%type)
as
begin
delete from emp where empno=vempno;
end p_delete;
procedure p_update(vempno emp.empno%type,vename emp.ename%type)
as
begin
update emp set ename=vename where empno=vempno;
end p_update;
end TT;
调用相应的过程:
execute tt.p_insert(8888,'ALSANTE');
execute tt.p_delete(8888);
execute tt.p_update(8888,'MING');
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询