0
套餐:檢查以下包
create or replace package manage_emps
is
tax_rate constant number(5,2) := .28;
v_id number;
procedure insert_emp(p_deptno number,p_sal number);
procedure delete_emp;
procedure update_emp;
function calc_tax(p_sal number) return number;
end;
包體:
create or replace package body manage_emps
is
procedure update_sal(p_raise_amt number)
is
begin
update emp
set sal = (sal * p_raise_amt) + sal;
where empno = v_id;
end;
procedure insert_emp(p_deptno number,p_sal number)
is
begin
insert into emp(empno,deptno,sal)
values(v_id,p_deptno,p_sal);
end;
procedure delete_emp
is
begin
delete from emp
where empno = v_id;
end;
procedure update_emp
is
begin
v_sal number(10,2);
v_raise number(10,2);
select sal into v_sal
from emp
where empno = v_id;
if v_sal < 500 then
v_raise := .05;
elsif v_sal < 1000 then
v_raise := .07;
else
v_raise := .04;
end if;
update_sal(v_raise);
end;
function calc_tax(p_sal number) return number
is
begin
return p_sal * tax_rate;
end;
end;
的問題是 「?有多少公共程序在MANAGE_EMPS包」 我回答「三」。它怎麼會是錯的?顯然包裝規格中提到了3個功能。該程序的聲明/主體位於包裹的主體中,然後是其私有的。在這裏,過程UPDATE_SAL是私有的。但正確的答案是:「無」。沒有公共程序?怎麼樣 ?