Sei sulla pagina 1di 4

Test: Quiz: Managing Package Concepts 1. What will be displayed when a user executes the following statement?

SELECT object_name FROM user_objects WHERE object_type LIKE 'PACK%'; Mark for Review (1) Points The names of all package specifications in the user's schema The names of all package specifications and package bodies in the user's schema (*) The parameters which must be used when invoking all packaged subprograms in the user's schema The detailed code of all packages in the user's schema The names of all packages which can be invoked by the user

Correct 2. We want to remove both the specification and the body of package CO_PAC K from the database. Which of the following commands will do this? Mark for Review (1) Points DROP BOTH co_pack; DROP PACKAGE BODY co_pack; DROP PACKAGE co_pack; (*) DROP PACKAGE SPECIFICATION co_pack; None of the above

Correct 3. Your schema contains a package called EMP_PKG. You want to remove the p ackage body but not the specification. The correct syntax to do this is: DROP BO DY emp_pkg; True or False? Mark for Review (1) Points

True False (*)

Correct 4. A local variable defined inside a package procedure is visible to the c alling environment. True or False? Mark for Review (1) Points True False (*)

Correct 5. Examine the following package specification: CREATE OR REPLACE PACKAGE mypack IS percent_tax NUMBER := 20; PROCEDURE proc1; END mypack; The package body of mypack also includes a function called func1. Which of the f ollowing statements are true? (Choose three.) Mark for Review (1) Points (Choose all correct answers) proc1 is a public procedure and func1 is a private function. (*)

The package will not compile because you cannot declare variables in the specification, only procedures and functions. . The variable can be modified by: BEGIN mypack.percent_tax := 10; END; (*)

The function can be invoked from outside the package.

The procedure can be invoked by: BEGIN mypack.proc1; END; (*)

Incorrect. Refer to Section 10 Lesson 2. 6. SCOTT's schema contains a package EMP_PKG which contains a public proce dure EMP_SAL which accepts a NUMBER parameter. Which of the following will invok e the function successfully? Mark for Review (0) Points emp_pkg.emp_sal(101); scott.emp_pkg.emp_sal(101): (*) emp_sal(101); None of the above. All of the above.

Correct 7. A public component declared in the package specification can be referen ced by a private component defined in the package body. True or False? Mark for Review (1) Points True (*) False

Correct 8. Which one of the following queries would you use to see the detailed co de of a package called EMP_PKG? Mark for Review (1) Points SELECT text FROM user_source WHERE name = 'EMP_PKG' AND type = 'PACKAGE' ORDER BY line;

SELECT source FROM user_packages WHERE name = 'EMP_PKG' AND type = 'PACKAGE BODY' ORDER BY line; SELECT text FROM all_source WHERE name = 'EMP_PKG' AND type = 'PACKAGE' ORDER BY line; SELECT text FROM user_source WHERE name = 'EMP_PKG' AND type = 'PACKAGE BODY' ORDER BY line; (*)

Correct 9. A local variable declared within a procedure in a package can be refere nced by any other component of that package. True or False? Mark for Review (1) Points True False (*)

Correct 10. When one component of a package is called, all the package's components are loaded into memory. True or False? Mark for Review (1) Points True (*) False

Correct

Potrebbero piacerti anche