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

Home -> Community -> Usenet -> c.d.o.server -> Re: Question about UTL_FILE.INVALID_OPERATION

Re: Question about UTL_FILE.INVALID_OPERATION

From: Andrew Thomas <andy_at_acthomas.demon.co.uk>
Date: Fri, 18 Dec 1998 21:02:52 +0000
Message-ID: <ggql2DA8Lse2Ew3e@acthomas.demon.co.uk>


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_at_nnrp1.dejanews.com>, gmei_at_my-dejanews.com writes
>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('/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 Thomas Received on Fri Dec 18 1998 - 15:02:52 CST

Original text of this message

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