/temp/my_files is an existing folder in the server, facultylist.txt is an existing text file in this folder Examine the following commands that are executed by the DBA:
SQL>CREATE DIRECTION my_dir AS ‘ /temp/my_files’:
SQL/GRANT READ ON DIRECTORY my_dir To pubiic:
View the Exhibit and examine the procedure created by user SCOTT to read the list of faculty names from the text file.
SCOTT executes the procedure as follows:
SQL>SET SERVEROUTPUT ON
SQL>EXEC read_file (‘MY_DIR’, FACULTYLIST.TXT’)
What is the outcome?
A.
It goes into an infinite loop.
B.
It executes successfully and displays only the list of faculty names.
C.
It does not execute and displays an error message because the end-of-file condition is not taken care of.
D.
It executes successfully and displays the list of faculty names followed by a “no data found” error message.
Whether this answer is correct?
D is right
If no text was read due to end of file, the NO_DATA_FOUND exception is raised.
http://docs.oracle.com/cd/E11882_01/appdev.112/e10577/u_file.htm
Answer: D
D
Correct answer is D.
Useful article about utl_file usage: https://community.oracle.com/thread/2312646
D is correct
Correct answer is C.
There is all output, but the execution is terminated after NO_DATA_FOUND is raised.
??
As Juastas said: Correct answere is C.
From the oracle documentaion about the utl_file.get_line procedure, If no text was read due to end of file, the NO_DATA_FOUND exception is raised.
So when we reach the end of file we will get the exception, which will interupt the execution.
Yes, it will interupt at the end, but before that, all rows will allready be printed, it’s easy to run test, check
yes but “Messages sent using DBMS_OUTPUT are not actually sent until the sending subprogram or trigger completes. There is no mechanism to flush output during the execution of a procedure.”
Program is not completed – so NO OUTPUT
Answer C
“yes but “Messages sent using DBMS_OUTPUT are not actually sent until the sending subprogram or trigger completes. There is no mechanism to flush output during the execution of a procedure.”
Program is not completed – so NO OUTPUT
Answer C”
My mistake after error output is visible
Answer D
I have recently started a website, the information you offer on this web site has helped me tremendously. Thank you for all of your time & work.