Home » SQL & PL/SQL » SQL & PL/SQL » Removing CSV File Using UTL_FILE
Removing CSV File Using UTL_FILE [message #427945] Mon, 26 October 2009 09:15 Go to next message
ramya29p
Messages: 100
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 #427962 is a reply to message #427945] Mon, 26 October 2009 09:48 Go to previous messageGo to next message
Michel Cadot
Messages: 64106
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Does oracle has the privilege to write into the directory?

Regards
Michel
Re: Removing CSV File Using UTL_FILE [message #427974 is a reply to message #427945] Mon, 26 October 2009 10:16 Go to previous messageGo to next message
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 #428029 is a reply to message #427974] Mon, 26 October 2009 23:10 Go to previous messageGo to next message
ramya29p
Messages: 100
Registered: November 2007
Location: Chennai
Senior Member
Ya that Directory is Having Write Privilege. If i remove the .TXT file it is working.
Re: Removing CSV File Using UTL_FILE [message #428030 is a reply to message #428029] Mon, 26 October 2009 23:14 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>If i remove the .TXT file it is working.
If it is working, then please post reproducible proof it works using CUT & PASTE

[Updated on: Mon, 26 October 2009 23:17]

Report message to a moderator

Re: Removing CSV File Using UTL_FILE [message #428034 is a reply to message #428029] Mon, 26 October 2009 23:37 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
ramya29p wrote on Tue, 27 October 2009 05:10
Ya 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?
Previous Topic: Reflection (merged 3)
Next Topic: Missing keyword to update related column
Goto Forum:
  


Current Time: Mon Dec 05 02:54:34 CST 2016

Total time taken to generate the page: 0.12797 seconds