| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Problem with UTL_FILE.FOPEN 'append' option
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;
>> ls -ld /cce/myLogin >> drwxrwxrwx 3 myLogin xml_export 512 Feb 1 11:19 /cce/myLogin
![]() |
![]() |