Home » SQL & PL/SQL » SQL & PL/SQL » UTL_FILE problem
icon8.gif  UTL_FILE problem [message #142532] Sat, 15 October 2005 02:35 Go to next message
ponsolomon
Messages: 8
Registered: June 2005
Location: Chennai
Junior Member
Hi,

I m using Oracle 10.1.0, when i m trying to create a function and execute i encounter a problem..

CREATE OR REPLACE FUNCTION F1 RETURN NUMBER IS
v_output_file1 utl_file.file_type;
BEGIN
v_output_file1 := utl_file.fopen('LOG_DIR', 'NEW.txt', 'a');
utl_file .put_line(v_output_file1, 'NATURE and Beauty');
utl_file.fclose_all;
RETURN 1;
END;


ORA-29289: directory access denied
ORA-06512: at "SYS.UTL_FILE", line 33
ORA-06512: at "SYS.UTL_FILE", line 436
ORA-06512: at "CEM.F1", line 4
ORA-06512: at line 15

Note : i have create a directory called log_dir as sys and grant read permission to public. But the same coding is working in 8i

Kindly help me in this regard

Solomon
icon6.gif  Re: UTL_FILE problem [message #142598 is a reply to message #142532] Sun, 16 October 2005 15:20 Go to previous messageGo to next message
fiaz_ksa
Messages: 3
Registered: October 2005
Location: Saudi Arabia
Junior Member
Utl_file_dir path must match with folder on Database server

you might try it on client side

Re: UTL_FILE problem [message #142676 is a reply to message #142598] Mon, 17 October 2005 03:19 Go to previous messageGo to next message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
Hi

Quote:

i have create a directory called log_dir as sys and grant read permission to public

You are trying to WRITE to the directory. Grant Write priviledge to the appropriate users.

HTH
Jim
Re: UTL_FILE problem [message #142709 is a reply to message #142676] Mon, 17 October 2005 06:28 Go to previous messageGo to next message
ponsolomon
Messages: 8
Registered: June 2005
Location: Chennai
Junior Member
Thank you Jim,

But still i m getting error like this..

ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 33
ORA-06512: at "SYS.UTL_FILE", line 460
ORA-29283: invalid file operation
ORA-06512: at "CEM.F1", line 4

How can i proceed further.

Solomon
Re: UTL_FILE problem [message #142718 is a reply to message #142709] Mon, 17 October 2005 06:59 Go to previous message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
Looks like an OS priviledge issue. Make sure that the user has OS permission to write/read that location.
Jim
Previous Topic: Search,concatenate,merge in single Select - Thanks
Next Topic: How can I read/write data files (text file) from PL/SQL Script
Goto Forum:
  


Current Time: Wed Aug 06 07:47:06 CDT 2025