/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.
B
D
No data found Error
d
D
D
Why D ??
There is no exception defined, doesn’t it mean that error would get when no data can be get from file ?
D
B.
When reading a file in a loop, the loop should exit when it detects the no_data_found exception.
“D”
It executes and displays the data from given file.
Then it breaks with error message “no data found”.
http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/u_file.htm#ARPLS70930
If no text was read due to end of file, the NO_DATA_FOUND exception is raised.
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:
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);
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.
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.
ФИТ
ФЭН
ФТФ
АСФ
ЮР
ФМО
L.N.Gumilyov Eurasian National University?
D
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.
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
D
I tried to do it
http://www.sitiosdecitas.es/edarling/
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.
we came across a cool web page that you simply may possibly take pleasure in. Take a search in case you want
very couple of web-sites that come about to be detailed below, from our point of view are undoubtedly nicely really worth checking out
Sites of interest we have a link to
always a large fan of linking to bloggers that I enjoy but do not get a great deal of link appreciate from
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
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
very few web sites that transpire to be comprehensive beneath, from our point of view are undoubtedly very well really worth checking out
below you will uncover the link to some sites that we think you ought to visit
Sites of interest we have a link to
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
The data talked about within the report are several of the very best available
Sites of interest we have a link to
Got a lot out of the post. Thanks aiotestking.com!
healthierway.tumblr.com
Really enjoyed this blog article.Much thanks again. Great.
http://www.annuaire-jouets.com
Great blog.Really thank you! Really Great.
http://www.asmomaanselka.com
B
D is correct
??
But wanna remark that you have a very nice web site , I the style and design it actually stands out.
http://www.yQORPNu0A0.com/yQORPNu0A0