Quiz 10
Quiz 10
Quiz 10
(1) Points
Global variables
Explicit cursors
Triggers (*)
Procedures
Functions
Correct
(1) Points
DESCRIBE del_emp
DESCRIBE show_emp
DESCRIBE emp_pack(del_emp, show_emp)
None of these.
DESCRIBE emp_pack.del_emp
DESCRIBE emp_pack.show_emp
DESCRIBE emp_pack (*)
Correct
(1) Points
The keyword PACKAGE is missing. (*)
Nothing is wrong, this code contains no errors.
The first line should be:
CREATE OR REPLACE PACKAGE SPECIFICATION mypack IS
You cannot declare constants in the specification.
A package must contain at least one function.
Correct
(1) Points
mypack.myproc(35); (*)
IF NOT mypack.myfunc(SYSDATE) THEN
DBMS_OUTPUT.PUT_LINE('Message');
END IF; (*)
mypack.myfunc('22-Jan-2007');
v_num := mypack.myproc(22);
myproc(40);
Correct
5. Which of the following are good reasons for creating and using Packages?
(1) Points
A and C
A, B, C, and D
A and B
A, B, and C
A, B, and D (*)
Correct
6. The following package is valid. True or False?
CREATE OR REPLACE PACKAGE exceptions_pkg IS
e_cons_violation EXCEPTION;
PRAGMA EXCEPTION_INIT (e_cons_violation, -2292);
e_value_too_large EXCEPTION;
PRAGMA EXCEPTION_INIT (e_value_too_large, -1438);
END exceptions_pkg;
(1) Points
True (*)
False
Correct
(1) Points
True
False (*)
Correct
(1) Points
True (*)
False
Correct
9. How would you invoke the constant mile_to_km from the global_consts
bodiless package at VARIABLE A?
DECLARE
distance_in_miles NUMBER(5) := 5000;
distance_in_km NUMBER(6,2);
BEGIN
distance_in_km :=
distance_in_miles * VARIABLE A;
DBMS_OUTPUT.PUT_LINE(distance_in_km);
END;
(1) Points
mile_to_km (global_consts)
global_consts.mile_to_km (*)
global_consts (mile_to_km)
mile_to_km.global_consts
Correct
10. 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;
(1) Points
True (*)
False
Correct
Previous
11. Which of the following will display the detailed code of the subprograms
in package DEPTPACK in your schema ?
Mark for Review
(1) Points
SELECT text FROM USER_SOURCE
WHERE object_name = 'DEPTPACK'
AND object_type = 'PACKAGE BODY'
ORDER BY line;
SELECT text FROM USER_SOURCE
WHERE name = 'DEPTPACK'
AND type = 'PACKAGE BODY'
ORDER BY line; (*)
SELECT text FROM USER_SOURCE
WHERE name = 'DEPTPACK'
AND type = 'PACKAGE'
ORDER BY line;
SELECT text FROM USER_SOURCE
WHERE name = 'DEPTPACK'
AND type = 'BODY'
ORDER BY line;
Correct
(1) Points
Point A
Point D
Point B or Point C, they will both work
Point B (*)
Point C
Correct
(1) Points
The parameters which must be used when invoking all packaged
subprograms in the user's schema
The names of all package specifications 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
The names of all package specifications and package bodies in the user's
schema (*)
Correct
(1) Points
True (*)
False
Correct
(1) Points
The statement will fail because you must drop the body before you can drop
the specification.
The specification will be dropped but the body will be retained.
The body will be dropped but the specification will be retained.
Both the specification and the body will be dropped. (*)
Correct
Previous