Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question about UTL_FILE.INVALID_OPERATION

694 views
Skip to first unread message

gm...@my-dejanews.com

unread,
Dec 17, 1998, 3:00:00 AM12/17/98
to
Hi:

I have a pl/sql procedure which generates invalid operation error. I tried
both on my NT's sqlplus and my unix sqlplus environments. I also checked the
init.ora file to make sure it has utl_file_dir = *.

No matter whether I try FOPEN with 'W' or 'R' on NT or Unix's sqlplus, I
always get UTL_FILE.INVALID_OPERATION exception. (I know I need to use
different delimiter on NT and Unix). I made sure that when I try 'R' case, I
have the file '123.log' already sitting there. I can also manually create
files on NT and UNIX, so there is no problem of accessing file privilege.

Thanks for your help. Please send a copy of your reply to
gm...@usclearing.com


Guang Mei
US Clearing Corp, 26 Broadway, New York, NY 10004
tel: 212-747-2311 fax: 212-849-1783
e-mail: gm...@usclearing.com

---------
Here is the code:

--------------------------
set serveroutput on size 1000000
set lin 120

declare

temp_file_handle UTL_FILE.FILE_TYPE;

begin

-- temp_file_handle
:=UTL_FILE.FOPEN('/export/home1/infosys','test.rpt','W'); -- on UNIX

temp_file_handle :=UTL_FILE.FOPEN('C:\','123.log','R'); -- on NT

--UTL_FILE.PUT_LINE (temp_file_handle, 'This is a test');

UTL_FILE.FCLOSE (temp_file_handle);

EXCEPTION
WHEN UTL_FILE.INTERNAL_ERROR
THEN
DBMS_OUTPUT.put_line('File System Internal Error!');

WHEN UTL_FILE.INVALID_OPERATION
THEN
DBMS_OUTPUT.put_line('File System Invalid Operation!');

WHEN UTL_FILE.INVALID_PATH
THEN
DBMS_OUTPUT.put_line('Invalid File Path!');

WHEN UTL_FILE.WRITE_ERROR
THEN
DBMS_OUTPUT.put_line('File System Write Error!');

WHEN OTHERS
THEN
UTL_FILE.FCLOSE_ALL;
DBMS_OUTPUT.put_line('Other UTL_FILE Error!');

end;
/
----------------------


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Andrew Thomas

unread,
Dec 18, 1998, 3:00:00 AM12/18/98
to
I think that you will find the utl_file_dir entry in init.ora
must specify the exact pathname of the directory that you are going to
use for the call to UTL_FILE.fopen. Also be careful to get the case
exactly right (ie the same in init.ora and your calls to utl_file.fopen)

Andy
In article <75bf1p$40$1...@nnrp1.dejanews.com>, gm...@my-dejanews.com writes

--
Andy Thomas

0 new messages