I am trying to read BLOB from Windows directory located on the Oracle 11g DB server:
create or replace directory BLOB_DIR as 'C:\data\images';
grant read, write on directory BLOB_DIR to public;
set serveroutput on;
declare
l_bfile BFILE;
begin
l_bfile := BFILENAME('BLOB_DIR', 'blob.jpg');
DBMS_LOB.fileopen(l_bfile, DBMS_LOB.file_readonly);
DBMS_LOB.fileclose(l_bfile);
end;
/
However, I am getting the following error:
ORA-22288: file or LOB operation FILEOPEN failed
ORA-06512: at "SYS.DBMS_LOB", line 744
ORA-06512: at line 5
I checked the directory and file exist and all the permissions are given to Everyone.
What am I doing wrong? How to get more specific error message?