Section 11
The DBMS_OUTPUT.PUT procedure places text in a buffer but
does not display the contents of the buffer. True or False?
True
(*)
False
Why is it better to use DBMS_OUTPUT only in anonymous
blocks, not inside stored subprograms such as 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 can raise a NO_DATA_FOUND exception if used inside a packaged
procedure
Because
DBMS_OUTPUT should be used only for testing and debugging PL/SQL code (*)
Because
DBMS_OUTPUT cannot be used inside procedures
Which of the following exceptions can be raised ONLY when
using the UTL_FILE package? (Choose two.)
(Choose
all correct answers)
NO_DATA_FOUND
E_MYEXCEP
INVALID_PATH
(*)
VALUE_ERROR
READ_ERROR
(*)
Using the FOPEN function, you can do which actions with the
UTL_FILE package? (Choose 2)
(Choose
all correct answers)
It is
used to read and write text files stored outside the database. (*)
It is
used to append to a file until processing is complete. (*)
It is
used to find out how much free space is left on an operating system disk.
It is
used to manipulate large object data type items in columns.
Which general exceptions may be handled by the UTL_FILE
package? (Choose 2)
(Choose
all correct answers)
ZERO_DIVIDE
TOO_MANY_ROWS
VALUE_ERROR
(*)
NO_DATA_FOUND
(*)
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?)
True
(*)
False
The DBMS_OUTPUT package is useful for which of the following
activities? (Choose two)
(Choose
all correct answers)
Interact
with a user during execution of a function or procedure
Display
results to the developer during testing for debugging purposes (*)
Trace
the code execution path for a function or procedure (*)
Write
operating system text files to the user's screen
The UTL_FILE package can be used to read and write binary
files such as JPEGs as well as text files. True or False?
True
False
(*)
The UTL_FILE package can be used to create binary files such
as JPEGs as well as text files. True or False?
True
False
(*)
What will be displayed when the following code is executed?
BEGIN
DBMS_OUTPUT.PUT('I
do like');
DBMS_OUTPUT.PUT_LINE('to be');
DBMS_OUTPUT.PUT('beside the seaside');
END;
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
I do
like to be beside the seaside
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?
True
False
(*)
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?
True
False
(*)
Package MULTIPACK declares the following global variable:
g_myvar NUMBER;
User DICK executes the following:
multipack.g_myvar
:= 45;
User HAZEL now connects to the database. Both users
immediately execute:
BEGIN
DBMS_OUTPUT.PUT_LINE(multipack.g_myvar);
END;
What values will Dick and Hazel see?
Dick:
45, Hazel: null (*)
Dick:
45, Hazel: 0
Both
queries will fail because the syntax of DBMS_OUTPUT.PUT_LINE is incorrect
Dick:
0, Hazel: 0
Dick:
45, Hazel: 45
When a user session changes the value of a package variable,
the new value can immediately be seen by other sessions. True or False?
True
False
(*)
In the following example, which statement best fits in Line
1? (Choose 1)
DECLARE
v_more_rows_exist
BOOLEAN := TRUE;
BEGIN
-- Line 1
LOOP
v_more_rows_exist
:= curs_pkg.fetch_n_rows(3);
DBMS_OUTPUT.PUT_LINE('-------');
EXIT WHEN NOT
v_more_rows_exist;
END LOOP;
curs_pkg.close_curs;
END;
curs_pkg.open_curs;
(*)
EXIT
WHEN curs_pkg.emp_curs%NOTFOUND;
curs_pkg.close_curs;
curs_pkg.emp_curs%ISOPEN;
No comments:
Post a Comment