Test: Quiz: Creating Packages 1.

To be able to invoke a package subprogram from outside the package, it must be declared in the package: Mark for Review (1) Points Body Specification Body and the specification (*) None of the above

Incorrect. Refer to Section 10 Lesson 1. 2. Package Specification DEPT_PACK was created by the following code: CREATE OR REPLACE PACKAGE dept_pack IS PROCEDURE ins_dept(p_deptno IN NUMBER); FUNCTION get_dept(p_deptno IN NUMBER) RETURN VARCHAR2; END dept_pack; Which of the following are correct syntax for invoking the package subprograms? (Choose two.) Mark for Review (1) Points (Choose all correct answers) BEGIN dept_pack.ins_dept(20); END; (*)

BEGIN dept_pack.get_dept(20); END; DECLARE v_deptname VARCHAR2(20); BEGIN v_deptname := get_dept(50); END; CREATE PROCEDURE dept_proc IS v_deptname VARCHAR2(20); BEGIN v_deptname := dept_pack.get_dept(40);

END; (*)

BEGIN dept_pack(30); END;

Incorrect. Refer to Section 10 Lesson 1. 3. Package EMP_PACK contains two procedures, DEL_EMP and SHOW_EMP. You wan t to write an anonymous block which invokes these procedures but you have forgot ten which parameters they use. Which of the following will give you this informa tion? Mark for Review (1) Points DESCRIBE del_emp DESCRIBE show_emp DESCRIBE emp_pack(del_emp, show_emp) DESCRIBE emp_pack (*)

DESCRIBE emp_pack.del_emp DESCRIBE emp_pack.show_emp None of the above

Correct 4. A number variable declared in a package is initialized to 0 unless assi gned another value. True or False? Mark for Review (1) Points True False (*)

Correct 5. Which of the following are good reasons to group a set of procedures an d functions into a package? Mark for Review (1) Points

Application developers do not need to know the details of the package bo dy code. Related subprograms and variables can be grouped together for easier man agement and maintenance. If the detailed code is changed, aplications which invoke the package do not need to be recompiled. All of the above. (*)

Correct 6. Which of the following can be included in a package? (1) Points procedures variables PL/SQL types Exceptions All of the above (*) Mark for Review

Correct 7. The two parts of a package are stored as separate objects in the databa se. True or False? Mark for Review (1) Points True (*) False

Correct 8. In which component of a package is the full definition of a public proc edure written? Mark for Review (1) Points

Body (*) Specification Both the body and the specification Neither the body nor the specification

Incorrect. Refer to Section 10 Lesson 1.

Sign up to vote on this title
UsefulNot useful