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 40

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


Uladzimir

Uladzimir

D

No data found Error

Raivis

Raivis

Why D ??
There is no exception defined, doesn’t it mean that error would get when no data can be get from file ?

A.

A.

B.

When reading a file in a loop, the loop should exit when it detects the no_data_found exception.

User

User

With the UTL_FILE package, PL/SQL programs can read and write operating system text files. UTL_FILE provides a restricted version of operating system stream file I/O.

This chapter contains the following topics:

Vova M

Vova M

C

NO_DATA_FOUND
Raised when you read the end of the file with UTL_FILE.GET_LINE
In order to executes successfully there should be something like:
WHEN NO_DATA_FOUND
THEN
UTL_FILE.FCLOSE (names_file);

Balthazar

Balthazar

D

If the line does not fit in the buffer, a READ_ERROR exception is raised. If no text was read due to end of file, the NO_DATA_FOUND exception is raised. If the file is opened for byte mode operations, the INVALID_OPERATION exception is raised.

Because the line terminator character is not read into the buffer, reading blank lines returns empty strings.

khurshid

khurshid

01403. 00000 – “no data found”
*Cause: No data was found from the objects.
*Action: There was no data from the objects which may be due to end of fetch.
ФИТ
ФЭН
ФТФ
АСФ
ЮР
ФМО

Eurer

Eurer

L.N.Gumilyov Eurasian National University?

Justas

Justas

C is correct answer.
It does not execute successfully. For instance: line utl_file.fclose(f_file); is never executed because of ORA-01403: no data found.

SK

SK

D

create or replace procedure read_file(dirname VARCHAR2, textfile VARCHAR2) is
f_file utl_file.file_type;
v_buffer varchar2(200);
begin
f_file:= utl_file.fopen(dirname, textfile,’R’);
LOOP
UTL_File.get_line(f_file, v_buffer);
dbms_output.put_line(v_buffer);
end loop;
utl_file.fclose(f_file);
end read_file;

SQL> exec read_file(‘DIR_TEXTFILES’,’log.txt’);
anna sksk
satish kkk
rah\ jj
jfom
fon
BEGIN read_file(‘DIR_TEXTFILES’,’log.txt’); END;

*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at “SYS.UTL_FILE”, line 106
ORA-06512: at “SYS.UTL_FILE”, line 746
ORA-06512: at “HR.READ_FILE”, line 7
ORA-06512: at line 1

Larissa

Larissa

D
I tried to do it

Google

Google

Wonderful story, reckoned we could combine several unrelated information, nonetheless seriously worth taking a appear, whoa did one find out about Mid East has got more problerms at the same time.

youtubemp3download3- Youtube to mp3 converter

youtubemp3download3- Youtube to mp3 converter

we came across a cool web page that you simply may possibly take pleasure in. Take a search in case you want

how to create your own app

how to create your own app

very couple of web-sites that come about to be detailed below, from our point of view are undoubtedly nicely really worth checking out

recipes

recipes

Sites of interest we have a link to

kala jadu

kala jadu

always a large fan of linking to bloggers that I enjoy but do not get a great deal of link appreciate from

sodick

sodick

although internet websites we backlink to below are considerably not related to ours, we really feel they are actually worth a go as a result of, so possess a look

boo of ra

boo of ra

although internet sites we backlink to beneath are considerably not associated to ours, we really feel they’re truly really worth a go as a result of, so have a look

1000 Thread count sheets queen Egyptian cotton

1000 Thread count sheets queen Egyptian cotton

very few web sites that transpire to be comprehensive beneath, from our point of view are undoubtedly very well really worth checking out

Flat Belly Fast DVD Review

Flat Belly Fast DVD Review

below you will uncover the link to some sites that we think you ought to visit

David Miscavige

David Miscavige

Sites of interest we have a link to

full software download for pc

full software download for pc

we came across a cool site that you simply could possibly enjoy. Take a look in the event you want

специалисти по коремна хирургия

специалисти по коремна хирургия

please stop by the web pages we adhere to, like this 1, because it represents our picks in the web

Have a Drug & Toxin Free Body

Have a Drug & Toxin Free Body

The data talked about within the report are several of the very best available

Drug rehabilitation center

Drug rehabilitation center

Sites of interest we have a link to

Mackenzie Sonnen

Mackenzie Sonnen

Got a lot out of the post. Thanks aiotestking.com!

healthierway.tumblr.com

blue

blue

D is correct