Home » SQL & PL/SQL » SQL & PL/SQL » ORA-29283: invalid file operation (Oracle Database 11g Enterprise Edition Release - 64bit Production)
ORA-29283: invalid file operation [message #573475] Sat, 29 December 2012 05:01 Go to next message
Messages: 45
Registered: April 2005
Location: Mumbai
We are using the below procedure to generate the files on the DB server.

SQL> create or replace procedure write_to_file(p_dir varchar2,
2 p_file varchar2,
3 p_mode varchar2,
4 p_clob clob) as
5 l_output utl_file.file_type;
6 l_amt number default 32767;
7 l_offset number default 1;
8 l_length number default dbms_lob.getlength(p_clob);
9 new_clob clob;
12 l_output := utl_file.fopen(p_dir, p_file, p_mode, 32767);
13 while (l_offset < l_length) loop
14 new_clob:= SUBSTR(p_clob,l_offset,l_amt);
15 utl_file.put_line(l_output, new_clob,true);
16 l_offset := l_offset + dbms_lob.getlength(new_clob);
17 end loop;
18 utl_file.new_line(l_output);
19 utl_file.fclose(l_output);
20 end write_to_file;
21 /

Procedure created


This works fine we call this from PL/SQL developer tool.
However, when this procedure is called from Java JDBC, it is giving error

java.sql.SQLException: ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "SYS.OBP_UPGRADE_UTIL", line 2816
ORA-06512: at "SYS.OBP_UPGRADE_UTIL", line 3029
ORA-06512: at line 1

DB schema used for both are same (SYS)
Verified the directory on the DB server
This Procedure called from package with AUTHID CURRENT_USER option.

Does anyone has idea about this issue.
Re: ORA-29283: invalid file operation [message #573484 is a reply to message #573475] Sat, 29 December 2012 09:08 Go to previous message
Michel Cadot
Messages: 65139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previois topic:

Michel Cadot wrote on Wed, 29 August 2012 14:20
...Also please How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.

Also it seems you are unable to feedback and thank people in any of your topics.
Is it worth we spend time to help you to just get contempt in return?


Previous Topic: Please help me on how to pass date condition Dynamically.
Next Topic: Converting number column to date column
Goto Forum:

Current Time: Fri Aug 18 01:41:56 CDT 2017

Total time taken to generate the page: 0.07082 seconds