Q

Loading image to BLOB column

I seem to have a problem trying to load an image to a BLOB column. I have created a directory object using CREATE...

OR REPLACE DIRECTORY MYDIR AS 'C:Temp'. I have also initialized the BLOB column using the EMPTY_BLOB function. Then I ran a procedure that contains the following code segment:

      myfile  := BFILENAME( 'MYDIR', 'PHOTO.GIF' );  
      DBMS_LOB.fileopen(myfile, DBMS_LOB.file_readonly); 
      DBMS_LOB.loadfromfile( blob_col, myfile, DBMS_LOB.getlength(myfile) );  
      DBMS_LOB.fileclose(myfile); 

When I ran the procedure, I received the following error:
ORA-22288: file or LOB operation FILEOPEN failed
The system cannot find the path specified. I tried different ways to fix the path, but I still get the same error.
Did you try defining the DIRECTORY as 'C:Temp' (using a backslash)? As long as the directory and the file are present, that should work.

This was last published in March 2004

Dig Deeper on Oracle and SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close