0% found this document useful (0 votes)
216 views5 pages

Quiz 11

This document contains 15 multiple choice questions about PL/SQL packages. The questions cover topics like when a package's state is initialized, how package variables are scoped, how cursors and DBMS_OUTPUT work, and the purpose and capabilities of packages like UTL_FILE and UTL_MAIL. The correct answers are indicated with an asterisk.

Uploaded by

Andriy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
216 views5 pages

Quiz 11

This document contains 15 multiple choice questions about PL/SQL packages. The questions cover topics like when a package's state is initialized, how package variables are scoped, how cursors and DBMS_OUTPUT work, and the purpose and capabilities of packages like UTL_FILE and UTL_MAIL. The correct answers are indicated with an asterisk.

Uploaded by

Andriy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

 A package's state is initialized when the package is first loaded. True or


False?
Mark for Review

(1) Points
True (*)
False
Correct

2. Users A and B call the same procedure in a package to initialize a global


variable my_pkg.g_var. What will be the value of my_pkg.g_var for User A
at Point A?
User A: my_pkg.g_var is 10
User B: my_pkg.g_var is 10
User A: my_pkg.g_var is 50
User B: my_pkg.g_var is 25
Point A

Mark for Review

(1) Points
10
25
50 (*)
Correct

3. When a user session changes the value of a package variable, the new
value can immediately be seen by other sessions. True or False?
Mark for Review

(1) Points
True
False (*)
Correct

4. A cursor's state is defined only by whether it is open or closed and, if


open, how many rows it holds. True or False?
Mark for Review

(1) Points
True
False (*)
Correct

5. A cursor is declared in a package specification. User SIOBHAN opens the


cursor and fetches the first three rows from the cursor's active set, but does
not close the cursor.
User FRED now connects to the database. FRED can immediately fetch the
next three rows without opening the cursor. True or False?
Mark for Review

(1) Points
True
False (*)
Correct
6. The DBMS_OUTPUT gives programmers an easy-to-use interface to see,
for instance, the current value of a loop counter, or whether or not a
program reaches a particular branch of an IF statement. (True or False?)
Mark for Review

(1) Points
True (*)
False
Correct

7. The SEND procedure is for sending messages without attachments. True


or False?
Mark for Review

(1) Points
True (*)
False
Correct

8. Which of the following best describes the purpose of the UTL_FILE


package?
Mark for Review

(1) Points
It is used to find out how much free space is left on an operating system
disk.
It is used to load binary files such as employees' photos into the database.

It is used to read and write text files stored outside the database. (*)
It is used to query CHAR and VARCHAR2 columns in tables.
Correct

9. The UTL_FILE package can be used to read and write binary files such as
JPEGs as well as text files. True or False?
Mark for Review

(1) Points
True
False (*)
Correct

10. Why is it better to use DBMS_OUTPUT only in anonymous blocks, not


inside stored subprograms such as procedures?
Mark for Review

(1) Points
Because DBMS_OUTPUT cannot be used inside procedures
Because anonymous blocks display messages while the block is executing,
while procedures do not display anything until their execution has finished
Because DBMS_OUTPUT should be used only for testing and debugging
PL/SQL code (*)
Because DBMS_OUTPUT can raise a NO_DATA_FOUND exception if used
inside a packaged procedure
Correct
Previous
11. The DBMS_OUTPUT.PUT procedure places text in a buffer but does not
display the contents of the buffer. True or False?
Mark for Review

(1) Points
True (*)
False
Correct
12. Which DBMS_OUTPUT package subprogram places text into the buffer at
Line 1? (Choose one)

  IF v_bool1 AND NOT v_bool2 AND v_number < 25 THEN


    --Line 1
  ELSE
    ...
  END IF;
  DBMS_OUTPUT.NEW_LINE;
Mark for Review

(1) Points
DBMS_OUTPUT.PUT_LINE('IF branch was executed');
DBMS_OUTPUT.PUT('IF branch was executed'); (*)
DBMS_OUTPUT.NEW_LINE('IF branch was executed');
DBMS_OUTPUT.GET_LINE('IF branch was executed');
Correct

13. Which of the following procedures is not valid for the UTL_MAIL package
Mark for Review

(1) Points
SEND_ATTACH_VARCHAR2
All are valid.
SEND_ATTACH_BOOLEAN (*)
SEND_ATTACH_RAW
SEND
Correct

14. The DBMS_OUTPUT package is useful for which of the following


activities? (Choose two)
Mark for Review

(1) Points
Trace the code execution path for a function or procedure (*)
Interact with a user during execution of a function or procedure
Write operating system text files to the user's screen
Display results to the developer during testing for debugging purposes (*)
Correct

15. The UTL_FILE package contains several exceptions exclusively used in


this package. Which are they? (Choose 3)
Mark for Review

(1) Points
INVALID_PATH (*)
INVALID_OPERATION (*)
NO_DATA_FOUND
ZERO_DIVIDE
WRITE_ERROR (*)
Correct
Previous

You might also like