Hi,
I have 2 server: oracle db and application server
I want to read images from application server using dbms_lob. My script is fine if I execute it under oracle 8i, but it is wrong under oracle 9i.
Anybody know this problem, please advise!

Thanks in advance.

My script as below:

declare
l_blob blob;
l_bfile BFILE;
begin
DBMS_LOB.createtemporary (lob_loc => l_blob,
cache => TRUE,
dur => DBMS_LOB.call);
l_bfile := bfilename('MY_DIR', 'my_file.gif');
if DBMS_LOB.FILEEXISTS( l_bfile ) <> 1 then
dbms_output.put_line( 'Exists!');
else
dbms_output.put_line( 'Not Exists!');
end if;
dbms_output.put_line('length='||dbms_lob.getlength (l_bfile));
dbms_lob.fileopen(l_bfile, dbms_lob.file_readonly);
dbms_lob.fileclose(l_bfile);
dbms_output.put_line( 'OK');
end;

Here are the results:
Oracle 8i
Exists!
length=123456
OK
Oarcle 9i
Exists!
length=123456
ORA-22288: file or LOB operation FILEOPEN failed
ORA-06512: at "SYS.DBMS_LOB", line 504
ORA-06512: at line 38
ORA-06512: at line 50