Professional Documents
Culture Documents
Your schema contains four packages, each having a specification and a body. You have also been granted privileges to
access three packages (and their bodies) in other users' schemas. What will be displayed by the following query?
SELECT COUNT(*) FROM ALL_OBJECTS
WHERE object_type LIKE 'PACK%'
AND owner <> USER;
6 (*)
A public component declared in the package specification can be referenced by a private component defined
in the package body. True or False?
True (*)
Package NEWPACK contains several procedures and functions, including private function PRIVFUNC. From
where can PRIVFUNC be invoked? (Choose two.)
The package body of mypack also includes a function called func1. Which of the following statements are
true? (Choose three.)
A local variable declared within a procedure in a package can be referenced by any other component of that
package. True or False?
False (*)
To be able to invoke a package subprogram from outside the package, it must be declared in the package:
Every subprogram which has been declared in a package specification must also be included in the package
body. Triue or False?
True (*)
2 and 3 (*)
The following call to the function tax in the taxes_pkg package is invalid for what reason?
The call to the package is valid and will execute without error. (*)
Which of the following are not allowed in a bodiless package? (Choose three)
Which one of the following queries would you use to see the detailed code of a package called EMP_PKG?
SELECT text FROM user_source WHERE name = 'EMP_PKG' AND type = 'PACKAGE BODY' ORDER BY line; (*)
When one component of a package is called, all the package's components are loaded into memory. True or
False?
True (*)
In a package, public components are declared in the specification but private components are not. True or
False?
True (*)
SCOTT's schema contains a package EMP_PKG which contains a public procedure EMP_SAL which accepts a
NUMBER parameter. Which of the following will invoke the procedure successfully?
scott.emp_pkg.emp_sal(101): (*)
We never need to use a forward declaration when invoking a public subprogram. True or False?
True (*)
The following example shows a valid record data type and variable. True or False?
TYPE DeptRecTyp
IS RECORD (deptid NUMBER(4) NOT NULL := 99,
dname departments.department_name%TYPE,
loc departments.location_id%TYPE,
region regions.region_id%TYPE );
dept_rec DeptRecTyp;
True (*)
How would you invoke the constant km_to_mile from the global_consts bodiless package at VARIABLE A?
global_consts.km_to_mile (*)
True (*)
A number variable declared in a package is initialized to NULL unless assigned another value. True or False?
True (*)
Which part of a package must be created first, the specification or the body?
Body (*)
Which of the following are correct syntax for invoking the package subprograms? (Choose two.)