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
Andy
In article <75bf1p$40$1...@nnrp1.dejanews.com>, gm...@my-dejanews.com writes
--
Andy Thomas