| Removing CSV File Using UTL_FILE [message #427945] |
Mon, 26 October 2009 09:15  |
ramya29p
Messages: 146 Registered: November 2007 Location: Chennai
|
Senior Member |
|
|
Hi i am getting ORA-29283 error while removing csv file. Can any one tell me how to remove csv file from the particular directory?
declare
f utl_file.file_type;
p_file_name iftm_interface_definition.filename%type;
p_file_path iftm_interface_definition.directory%type;
BEGIN
p_file_path:= '/tmp';
p_file_name := 'rate.csv';
UTL_FILE.FREMOVE(location=>p_file_path,filename=>p_file_name);
END;
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 239
ORA-06512: at "SYS.UTL_FILE", line 1154
ORA-06512: at line 9
|
|
|
|
|
|
| Re: Removing CSV File Using UTL_FILE [message #427974 is a reply to message #427945] |
Mon, 26 October 2009 10:16   |
begin2007
Messages: 4 Registered: July 2009
|
Junior Member |
|
|
you should be create the directory first, for example,
create or replace directory UTL_FILE_DIR_TMP
as 'D:\tmp';
SQL> declare
2 f utl_file.file_type;
3 p_file_name varchar(64);
4 p_file_path varchar(64);
5
6 BEGIN
7
8 p_file_path:= 'UTL_FILE_DIR_TMP';
9 p_file_name := '1.xls';
10 UTL_FILE.FREMOVE(location=>p_file_path,filename=>p_file_name);
11 END;
12 /
PL/SQL procedure successfully completed
|
|
|
|
|
|
|
|
| Re: Removing CSV File Using UTL_FILE [message #428034 is a reply to message #428029] |
Mon, 26 October 2009 23:37  |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
ramya29p wrote on Tue, 27 October 2009 05:10Ya that Directory is Having Write Privilege. If i remove the .TXT file it is working.
If this is unix, this .csv file can have different access-privs then the .txt you tested.
Is the file in use? Maybe as an external table? Maybe by Excel or another spreadsheet progeam?
|
|
|
|