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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Problem with UTL_FILE.FOPEN 'append' option

Re: Problem with UTL_FILE.FOPEN 'append' option

From: Mike Rainville <mrainv_at_po-box.mcgill.ca>
Date: Fri, 02 Feb 2001 23:28:40 GMT
Message-ID: <3A7B42FC.9070406@po-box.mcgill.ca>

The UTL_FILE_DIR and the path in your program must both specify a directory to match the extension of the file you're creating:

'/cce/myLogin/xml' for your *.xml files

'/var/mylogs/log/ for my *.log files
You are allowed more than one UTL_FILE_DIR entry...

Good luck,
Mike Rainville

monsri_at_my-deja.com wrote:

> Hello,
>
> I've written the following stuff to write files on the
> server side:
>

>> Procedure test
>> IS
>>    DEF_EXPORT_DIR   varchar2(30) :='/cce/myLogin';
>>    F_NAME       varchar2(30) ;
>>    F_XML        UTL_FILE.FILE_TYPE;
>>    REF_NAME     varchar2(30) :='TEST';
>>    pout_RC      number;
>> BEGIN
>>    F_NAME:='myFile.xml';
>>    dbms_output.put_line('before OPEN');
>>    F_XML :=UTL_FILE.FOPEN(DEF_EXPORT_DIR, F_NAME, 'a');
>>    dbms_output.put_line('after OPEN');
>>    UTL_FILE.PUT_LINE(F_XML, 'Hello world');
>>    dbms_output.put_line('after PUT LINE');
>>    UTL_FILE.FCLOSE(F_XML);
>>    dbms_output.put_line('after FCLOSE');
>>    EXCEPTION
>>      [here follow my exceptions...]
>> 
>> END test;

>
>
> If the file myFile.xml already exists, no trouble, but when
> myFile.xml still DOES NOT exist in /cce/myLogin, I get the
> following error: UTL_FILE.INVALID_OPERATION ("the file could
> not be opened or operated on as requested").
>
> At the OS level, here is what we got: the login 'oracle' has
> been added to an 'xml_export' group created for this very
> purpose (be able to write in /cce/myLogin). The Unix user
> 'myLogin' belongs to this 'xml_export' group, and the
> UTL_FILE_DIR parameter of my init.ora points to '/cce/myLogin'
> (myLogin's $HOME). This /cce/myLogin directory is in 777:
>
>> ls -ld /cce/myLogin
>> drwxrwxrwx   3 myLogin  xml_export  512 Feb  1 11:19 /cce/myLogin

>
>
> Any further suggestions... ??
>
> Thanks a lot !
> Seb
>
>
>
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Fri Feb 02 2001 - 17:28:40 CST

Original text of this message

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