Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Question about UTL_FILE.INVALID_OPERATION

Question about UTL_FILE.INVALID_OPERATION

From: <gmei_at_genetics.com>
Date: Thu, 17 Dec 1998 17:25:30 GMT
Message-ID: <75beq6$28$1@nnrp1.dejanews.com>


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 gmei_at_usclearing.com

Guang Mei
US Clearing Corp, 26 Broadway, New York, NY 10004 tel: 212-747-2311 fax: 212-849-1783 e-mail: gmei_at_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('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 Received on Thu Dec 17 1998 - 11:25:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US