I have created a directory in my "C" drive with name of "SAP" as well in oracle also. Like this
SQL> conn sys/password as sysdba;
SQL> create or replace directory SAP as 'C:\SAP';
NOTE : I have copied 1.jpeg file
SQL> grant read,write on directory sap to scott;
SQL> conn scott/tiger;
SQL> create table test_lob(id number,name varchar2(10),pic bfile);
SQL> insert into test_lob(1,'saahithi',bfilename('SAP','1.jpeg'));
1 row created.
SQL> select dbms_lob.getlength(PIC) from test_lob;
ERROR at line 1:
ORA-22288: file or LOB operation GETLENGTH failed
The system cannot find the file specified.
ORA-06512: at "SYS.DBMS_LOB", line 566
I am using oracle 10.2.0.1 version.
You may try to open the file first with the DBMS_LOB.FILEOPEN procedure:
Hope this help,
Message was edited by: LubiezJean-Valentin
Is your database running on the server where C:\sap is located? The files sytem directory that the Oracle directory object points to needs to be visible to the database. Typically, that means either located on the database server itself, on on a network share of some kind visible to the database server/