I found this script on one of the oracle sites but I am getting an error that I don't understand... maybe someone could help...
1. Is it that the column is NULL (empty)
2. Is data there but it 'points' to a location that is not valid? If so, how can I find out what that data is?
Thanks in advance,
2 fil BFILE;
3 pos INTEGER;
4 amt BINARY_INTEGER;
5 buf RAW(40);
7 SELECT BFILE_ID INTO fil FROM mytable WHERE MY_ID = '21';
8 dbms_lob.open(fil, dbms_lob.lob_readonly);
9 amt := 40; pos := 1 + dbms_lob.getlength(fil); buf := '';
10 dbms_lob.read(fil, amt, pos, buf);
11 dbms_output.put_line('Read F1 past EOF: '||
15 WHEN no_data_found
18 dbms_output.put_line('End of File reached. Closing file');
20 -- or dbms_lob.filecloseall if appropriate
ERROR at line 1:
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 605
ORA-06512: at line 8
I've worked a little with BFILE's, so I'm not 100% sure, but the error code you listed usually points to errors in how you reference the DIRECTORY object. When you store the LOB, even though you specify the directory name as lower case, it is stored as upper case. When you retrieve it, make sure it is passed as upper.