View Exhibit 1 and examine the structure of the EMP table.
View Exhlbit2 and examine the code of the packages that you have created.
You issue the following command:
SQL> DROP PACKAGE manage_emp;
What is the outcome?
A. It drops both the MANAGE_EMP AND EMP__DET packages because of the cascading effect.
B. It drops the MANAGE_EMP package and invalidates only the body for the EMP_DET package.
C. It returns an error and does not drop the MAMAGE_EMP package because of the cascading effect.
D. It drops the MANAGE_EMP package and invalidates both the specification and body for the EMP_DET package.
Also think correct answer is B.
Verified by creating above packages:
create or replace package manage_emp is
v_empno number;
procedure del_emp (p_empno number);
end manage_emp;
/
create or replace package body manage_emp is
procedure del_emp (p_empno number) is
begin
delete from emp where empno=p_empno;
end del_emp;
end manage_emp;
/
create or replace package emp_det is
procedure emp_chk(p_empno number);
end emp_det;
/
create or replace package body emp_det is
procedure emp_chk(p_empno number) is
begin
manage_emp.del_emp(p_empno);
end emp_chk;
end emp_det;
/
HR@XE > select owner,object_name,object_type,status from dba_objects where status!=’VALID’;
no rows selected
HR@XE > DROP PACKAGE manage_emp;
Package dropped.
HR@XE > select owner,object_name,object_type,status from dba_objects where status!=’VALID’;
OWNER OBJECT_NAME OBJECT_TYPE STATUS
—————————— —————————— ——————- ——-
HR EMP_DET PACKAGE BODY INVALID