What is the outcome?

/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?

/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.



Leave a Reply 13

Your email address will not be published. Required fields are marked *


bala

bala

Whether this answer is correct?

Ahmed

Ahmed

D is correct

Justas

Justas

Correct answer is C.
There is all output, but the execution is terminated after NO_DATA_FOUND is raised.

Ceci

Ceci

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.

Maria

Maria

Yes, it will interupt at the end, but before that, all rows will allready be printed, it’s easy to run test, check

bib

bib

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

bib

bib

“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

borvestinkral

borvestinkral

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.