Beruflich Dokumente
Kultur Dokumente
Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.
Final Exam Semester 2
1. A single procedure can be both a referenced object and a dependent object.
True or False? Mark for Review
(1) Points
True (*)
False
2. Which of the following is NOT created when the utldtree.sql script is run?
Mark for Review
(1) Points
The DEPTREE view
The DEPTREE_FILL procedure
The USER_DEPENDENCIES view (*)
The DEPTREE_TEMPTAB table
3. Which of the following will display dependency information which has been
generated by executing the DEPTREE_FILL procedure? (Choose two.) Mark for Review
(1) Points
(Choose all correct answers)
The USER_DEPENDENCIES view
The DEPTREE view (*)
The UTLDTREE script
The DISPLAY_DEPTREE view
The IDEPTREE view (*)
4. Function FETCH_EMP references the EMPLOYEES table. The table is modified by:
ALTER TABLE employees ADD (resume CLOB);
When will the ORACLE server try to recompile FETCH_EMP automatically?
Mark for Review
(1) Points
Page 1
PLSQL feedback final exam semister 2
When the command ALTER FUNCTION fetch_emp COMPILE; is executed
Page 1 of 4
Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.
Final Exam Semester 2
6. Examine the following code:
CREATE VIEW ed_view AS
SELECT * FROM employees NATURAL JOIN departments;
CREATE PROCEDURE ed_proc IS
CURSOR ed_curs IS SELECT * FROM ed_view;
Which of the following statements about dependencies are true? (Choose two.)
Mark for Review
(1) Points
(Choose all correct answers)
ED_PROC is indirectly dependent on DEPARTMENTS (*)
7. Which of the following techniques will make it more likely that an invalidated
PL/SQL subprogram will recompile successfully? (Choose two.) Mark for Review
(1) Points
(Choose all correct answers)
Declaring record structures using %ROWTYPE (*)
Using a cursor FOR loop instead of opening and closing the cursor explicitly
SELECTing a list of column-names instead of using SELECT *
8. We want to store a complete copy of the DEPARTMENTS table (all the rows and
all the columns) in a single PL/SQL variable. Which of the following kinds of
variable could we use? Mark for Review
(1) Points
An INDEX BY table
A record
An INDEX BY table of records (*)
A CLOB
An explicit cursor
10. Which of the following PL/SQL data structures can store a collection? (Choose
two.) Mark for Review
(1) Points
(Choose all correct answers)
Page 3
PLSQL feedback final exam semister 2
An INDEX BY table (*)
A record
%ROWTYPE
An INDEX BY table of records (*)
A BLOB
Page 2 of 4
Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.
Final Exam Semester 2
11. Which of the following statements about LOB column datatypes is NOT true?
Mark for Review
(1) Points
BFILE data is stored outside the database.
One table can contain only one LONG or LONG RAW column.
CLOB is a deprecated datatype; LONG should be used instead. (*)
Binary (non-text) data can be stored in a BLOB column but not in a CLOB column.
A LONG RAW column can store up to 2GB of data.
12. BLOB, JPEG, BFILE and MP3 are all LOB column datatypes. True or False? Mark
for Review
(1) Points
True
False (*)
UPDATE job_applicants
SET resume = 'I worked for Oracle for five years'
WHERE candidate_id = 100;
(*)
DECLARE
v_locator CLOB;
BEGIN
v_locator := 'I worked for Oracle for five years';
UPDATE job_applicants
SET resume = DBMS_LOB.WRITE(v_locator)
WHERE candidate_id = 100;
END;
DECLARE
v_lobloc CLOB;
BEGIN
SELECT resume INTO v_lobloc FROM job_applicants
WHERE applicant_id = 100;
DBMS_LOB.WRITE(v_lobloc,14,21,'for five years');
END;
(*)
14. CLOB and BLOB are internal LOB datatypes, while BFILE is an external LOB
datatype. True or False? Mark for Review
(1) Points
True (*)
False
15. Table NEWEMP contains a PHOTO_ID column of datatype LONG RAW. Which of the
following will convert this column to a suitable new LOB datatype? Mark for Review
(1) Points
ALTER TABLE newemp COLUMN (photo_id BLOB);
Page 5
PLSQL feedback final exam semister 2
Page 3 of 4
Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.
Final Exam Semester 2
16. Which of the following will declare a composite PL/SQL data type named
COMPO_TYPE, containing two fields named FIELD1 and FIELD2? Mark for Review
(1) Points
DECLARE
compo_type
(field1 NUMBER,
field2 VARCHAR2(30));
DECLARE
TYPE compo_type IS
(field1 NUMBER,
field2 VARCHAR2(30));
DECLARE
TYPE compo_type IS RECORD
(field1 NUMBER,
field2 VARCHAR2(30));
(*)
DECLARE
compo_type IS RECORD
(field1 NUMBER,
Page 6
PLSQL feedback final exam semister 2
field2 VARCHAR2(30));
17. A PL/SQL package named MYPACK declares a record type named MYTYPE as a public
variable in the package specification. Which of the following anonymous blocks
successfully declares a local variable of datatype MYTYPE? Mark for Review
(1) Points
DECLARE
v_myrec IS RECORD mypack.mytype;
BEGIN ...
DECLARE
v_myrec mypack.mytype;
BEGIN ...
(*)
DECLARE
v_myrec mytype;
BEGIN ...
DECLARE
v_myrec IS RECORD (mypack.mytype);
BEGIN ...
18. The BIGEMP table contains a RESUME column of datatype BFILE, which has been
populated with locator values. The following code reads a BFILE locator value into a
variable, then checks whether the BFILE itself exists in the operating system
directory. If the file is present, the code opens the file and reads its contents.
What should be coded at Point A?
DECLARE
v_locator BFILE;
BEGIN
SELECT resume INTO v_locator FROM bigemp
WHERE employee_id = 100;
-- Point A
DBMS_LOB.FILEOPEN(v_locator);
DBMS_LOB.READ(v_locator, ....); ....
DBMS_LOB.FILECLOSE(v_locator);
END IF;
END;
Mark for Review
(1) Points
IF DBMS_LOB.FILEEXISTS(v_locator) THEN
Page 7
PLSQL feedback final exam semister 2
IF DBMS_LOB.FILEEXISTS THEN
IF BFILEEXISTS(v_locator) THEN
20. You have created several directory objects in the database, as pointers to
operating system directories which contain BFILEs. Which data dictionary view would
you query to see these directories? Mark for Review
(1) Points
USER_DIRECTORIES
USER_BFILES
ALL_DIRECTORIES (*)
USER_EXTERNAL_FILES
ALL_BFILES
Page 4 of 4
Page 8