|
Re: UTL FILE SETTING in Oracle 10G [message #126009 is a reply to message #126000] |
Thu, 30 June 2005 08:54   |
dmitry.nikiforov
Messages: 723 Registered: March 2005
|
Senior Member |
|
|
Oracle doesn't recommend to use UTL_FILE_DIR parameter.
In place of that you can create DIRECTORY object, grant
READ or WRITE privilege on it to particular users and
use directory alias instead of explicit path name:
SQL> CREATE DIRECTORY BASE_DIR AS 'C:\';
Directory created.
SQL> declare
2 out_file UTL_FILE.FILE_TYPE;
3 begin
4 out_file := UTL_FILE.FOPEN('BASE_DIR','test.txt','r');
5 UTL_FILE.FCLOSE(out_file);
6 end;
7 /
PL/SQL procedure successfully completed.
Be care - directory alias should be always upper-case in
fopen:
SQL> declare
2 out_file UTL_FILE.FILE_TYPE;
3 begin
4 out_file := UTL_FILE.FOPEN('base_dir','test.txt','r');
5 UTL_FILE.FCLOSE(out_file);
6 end;
7 /
declare
*
ERROR at line 1:
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 33
ORA-06512: at "SYS.UTL_FILE", line 436
ORA-06512: at line 4
Rgds.
|
|
|
Re: UTL FILE SETTING in Oracle 10G [message #126193 is a reply to message #126009] |
Fri, 01 July 2005 08:24   |
nitin_d_csn
Messages: 19 Registered: June 2005 Location: Mumbai
|
Junior Member |
 
|
|
SQL> declare
2 out_file UTL_FILE.FILE_TYPE;
3 begin
4 out_file := UTL_FILE.FOPEN('BASE_DIR','test.txt','r');
5 UTL_FILE.FCLOSE(out_file);
6 end;
7 /
declare
*
ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 475
ORA-29283: invalid file operation
ORA-06512: at line 4
i have run this code but i got the above errors
as per u r directions i have created the dir 'BASE_DIR' grant the
previleges read,write on 'BASE_DIR' but i still got error,i m
using linux server and windows as client.
please help
[Updated on: Fri, 01 July 2005 08:26] Report message to a moderator
|
|
|
Re: UTL FILE SETTING in Oracle 10G [message #126197 is a reply to message #126193] |
Fri, 01 July 2005 08:38   |
dmitry.nikiforov
Messages: 723 Registered: March 2005
|
Senior Member |
|
|
Quote: |
ORA-29283: invalid file operation
Cause: An attempt was made to read from a file or directory that does not exist, or file or directory access was denied by the operating system.
Action: Verify file and directory access privileges on the file system, and if reading, verify that the file exists.
|
Rgds.
|
|
|
|
|
|