UTL_FILE -> ORA-29283: invalid file operation
423561May 11 2006 — edited May 17 2006Hello 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