Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-22288: file or LOB operation FILEOPEN failed

SirDrinksalotJun 26 2009 — edited Jun 26 2009
Hi all,

I have been asked to look at a problem with some code that was written to open and read files into a PL/SQL block, but I seem to be having a problem with the error message as shown in the title. The full details of the message are:
ORA-22288: file or LOB operation FILEOPEN failed The program issued a command but the command length is incorrect
The section of code where this occurs is:
for frec in ( select * from dirlist where directoryname = dir_table(i) )
		loop
			v_data_table := 't_' || replace(substr(frec.filename,1,instr(frec.filename,'.')-1),'-','_');
				
			data_table_ddl(v_data_table, frec.filename, frec.directoryname);
			
			v_frec_filename := frec.filename;
			v_frec_directoryname := frec.directoryname;
			
			execute immediate 'select seq_jlmsqueueid.nextval from dual' into v_tran_id;
			
			dbms_lob.createtemporary(cl_file_contents, false, 10 );
			
			l_bfile := bfilename(frec.directoryname,frec.filename);
						
			dbms_lob.fileopen(l_bfile,dbms_lob.file_readonly);
It is the last line of this code that is causing the problem. I have checked that the file and location (as specified by frec.filename and frec.directoryname) are correct, and the files do exist.

Some reading around has indicated that it might be an OS permissions issue, but I have made sure that the folder / file iin question has permissions for the oracle user. Also, the directory object which designates where to look exists, the oly problem with this is I can't figure out how to check permissions for this object (read / write), anyone know how to do this?

Unfortunately this seems to be a very specific error, with very little written about it and the odd thing is this, when i first reviewed the code to isolate another problem a couple of weeks ago this problem was not occurring, i could open and read the file fine. And I didn't actually make any changes to the code back then, I was just reviewing it!

Any help would be most appreciated :)

Cheers

Dan

Edited by: SirDrinksalot on Jun 26, 2009 7:06 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2009
Added on Jun 26 2009
3 comments
1,634 views