ORA-22288: file or LOB operation FILEOPEN failed,No such file or directory
199599Jul 30 2009 — edited Jul 31 2009I need to save a image file in my PC to a blob column in database.
1) I have created a directory
create or replace directory CURRDIRECTORY as '/scratch/nkishore/images/';
2) Gave Read Permissions
grant read to directory CURRDIRECTORY for public;
3) Now Read the file and populate blob in my internal table eg:asm_filters_b
declare
ablob blob;
abfile bfile := bfilename('CURRDIRECTORY', 'a.gif'); -- Get a pointer to the file.
amount integer;
asize integer;
begin
--Our Internal Table and queries
update asm_filters_b
set image_file=empty_blob()
where filter_id=100010026280807;
select image_file into ablob from asm_filters_b where filter_id=100010026280807;
dbms_lob.fileopen(abfile);
asize := dbms_lob.getlength(abfile);
dbms_lob.loadfromfile(ablob, abfile, asize);
asize := dbms_lob.getlength(ablob);
dbms_output.put_line('Size of blob: ' || asize);
exception
when others then
dbms_output.put_line('An exception occurred');
dbms_output.put_line(sqlcode || sqlerrm);
end;
This gives ORA-22288: file or LOB operation FILEOPEN failed. No such file or directory comes up. I am not able to proceed. Any pointers would be of great help. Thanks.