Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UTL_FILE -> ORA-29283: invalid file operation

423561May 11 2006 — edited May 17 2006
Hello everyone!
I have to produce XML files as an output from PL/SQL procedures. I was trying to use UTL_FILE package for this purpose. I thought I followed what everone is suggesting to do in the forums - but so far I didn't succeed. Can someone please advise me where I am going wrong.

Here is what I did:

Version: Oracle 9i 92010


init.ora entry
-------------------------
*.utl_file_dir='/u01test/dev/test_UTL'

Creating directory
-------------------------
CREATE DIRECTORY testdir AS '/u01test/dev/test_UTL';
GRANT READ,WRITE ON DIRECTORY TESTDIR TO public;

directory structure on the server
------------------------------------------------
/u01test/dev/test_UTL/TESTDIR


Procedure
-------------------------

create or replace procedure utl_file_test_write
is
output_file utl_file.file_type;
begin

output_file := utl_file.fopen ('TESTDIR', 'test.txt', 'W');

utl_file.put_line (output_file, 'This file is created by UTL_FILE package');
utl_file.put_line (output_file, 'Test finished successfully');
utl_file.fclose(output_file);

End utl_file_test_write ;


The error I am getting is:
ORA-29283: invalid file operation

Please advise me where I am going wrong.
Thanks a lot
- M
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 14 2006
Added on May 11 2006
6 comments
2,733 views