Skip to Main Content

Oracle Database Discussions

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!

getting ORA-22285: non-existent directory or file for FILEOPEN operation

MunishDec 27 2011 — edited Dec 27 2011
Hi

I am trying to insert a .jpg into a table and I get ora-22285 error.
The database is 11g and the OS is windows 2008 R2 (64 bit).

These are the steps I took.

I edited the ini.ora file and added utl_fil_dir = c:\mun\*

I restarted the DB.

I made sure edumet.jpg do exist in c:\mun\photos directory.

3.
SQL> create or replace directory images as 'c:\mun\photos\';

Directory created.

SQL> grant all on directory images to public;

Grant succeeded.

SQL> declare
2 l_blob blob;
3 l_bfile bfile;
4 begin
5 insert into images values ( 'edumet', EMPTY_BLOB() )
6 returning images_image into l_blob;
7 l_bfile := bfilename( 'images', 'edumet.jpg' );
8 dbms_lob.fileopen( l_bfile );
9 dbms_lob.loadfromfile( l_blob, l_bfile, dbms_lob.getlength( l_bfile ) )
;
10 dbms_lob.fileclose( l_bfile );
11 end;
12 /
declare
*
ERROR at line 1:
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 744
ORA-06512: at line 8


What am I missing?

Thanks
Munish
This post has been answered by LKBrwn_DBA on Dec 27 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 24 2012
Added on Dec 27 2011
3 comments
2,690 views