Professional Documents
Culture Documents
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%ROWTYPE );
dept_rec DeptRecTyp;
(1) Points
True (*)
False
emp_pkg.emprec_type;
emprec_type.emp_pkg;
v_emp_table emprec_type.emp_pkg;
Subprograms (*)
Global variables
Correct
True (*)
False
True
False (*)
Correct
Procedures
Explicit cursors
Triggers (*)
Functions
Global variables
A and B
A, B and C
A and C
A, B and D (*)
A, B, C and D
The statement will fail because you must drop the body before you can dr
op the specification.
Correct
Section 10
11. Package NEWPACK contains several procedures and functio
ns, including private function PRIVFUNC. From where can PRIVFUNC be invoked? (Ch
oose two.) (1) Points
(Choose all correct answers)
True (*)
False
Correct
Point A
Point B (*)
Point C
Point D
14
6 (*)
Section 11
15. The UTL_FILE package can be used to create binary files
such as JPEGs as well as text files. True or False? (1) Points
True
False (*)
INVALID_PATH (*)
NO_DATA_FOUND
VALUE_ERROR
READ_ERROR (*)
E_MYEXCEP
Because DBMS_OUTPUT should be used only for testing and debugging PL/SQL
code (*)
Correct
I do like to be
beside the seaside
I do like
to be
beside the seaside
I do like to be
I do liketo be
(*)
I do like to be beside the seaside
The first 10 rows will be fetched, then the first 5 rows will be fetched
again.
Dick: 0, Hazel: 0
BIND
FETCH
PARSE
RETURN (*)
EXECUTE
26. Where would you place the BULK COLLECT statement in the
following example?
DECLARE
TYPE DeptRecTab IS TABLE OF departments%ROWTYPE;
dept_recs DeptRecTab;
CURSOR c1 IS
SELECT department_id, department_name, manager_id, location_id
-- Position A
FROM departments
WHERE department_id > 70;
BEGIN
OPEN c1
-- Position B;
FETCH c1
-- Position C
INTO dept_recs;
END;
(1) Points
Position A
Position B
Position C (*)
True (*)
False
28. FORALL can be used with any DML statement. True or Fals
e? (1) Points
True (*)
False
Correct
Section 13
29. What is the purpose of using the CALL statement in a tr
igger? (1) Points
It allows both DML events and DDL events to be handled using a single tr
igger.
DDL triggers
INSTEAD OF triggers
A row trigger
A statement trigger
A DDL trigger
An AFTER trigger
Incorrect. Refer to Section 13 Lesson 4.
TABLE
SCHEMA (*)
USER
DATABASE (*)
TABLE employees
33. What is the event that will cause the trigger on the em
p_details view below to fire?
CREATE OR REPLACE TRIGGER new_emp_dept
INSTEAD OF INSERT ON emp_details
BEGIN
INSERT INTO new_emps
VALUES (:NEW.employee_id, :NEW.last_name,
:NEW.salary, :NEW.department_id);
new_depts
SET dept_sal = dept_sal + :NEW.salary
WHERE department_id = :NEW.department_id;
END;
(1) Points
ON EACH ROW
ON EVERY ROW
True
False (*)
36. What is wrong with the following code example for a comp
ound trigger?
CREATE OR REPLACE TRIGGER log_emps
FOR UPDATE OF salary ON employees
COMPOUND TRIGGER
TYPE t_log_emp IS TABLE OF log_table%ROWTYPE
INDEX BY BINARY_INTEGER;
log_emp_tab t_log_emp;
AFTER EACH ROW IS
BEGIN
-- some action
END AFTER EACH ROW;
AFTER STATEMENT IS
BEGIN
-- some action
END AFTER STATEMENT;
END log_emps;
(1) Points
Correct
True (*)
False
True (*)
False
Correct
A database trigger
An application trigger
A view
40. Which of the following are NOT stored inside the databa
se? (Choose two.) (1) Points
(Choose all correct answers)
A database trigger
A sequence
Use triggers to override privilege checking and view other users' privat
e tables.
A procedure
A complex view
A trigger (*)
A function
A package
A subprogram that checks whether a user has typed the correct password t
o log on to the database.
Correct
46. A DML statement trigger fires only once for each trigge
ring DML statement, while a row trigger fires once for each row processed by the
triggering statement. True or False? (1) Points
True (*)
False
Correct