Hi all,
here is the procedure I hope this is good
but
still i am getting same error
i am sure pictures reside in photos directory as 'C:\myfiles'
CAN ANY ONE TELL ME where i am doing wrong here PLEASE...............
SQL> create or replace directory photos as 'C:\myfiles';
Directory created.
SQL> commit;
Commit complete.
SQL> grant read,write on directory photos to apps;
Grant succeeded.
SQL> commit;
Commit complete.
SQL> CREATE OR REPLACE procedure insert_img
2 (p_catalogn number,p_photo varchar2)
3 as
4 f_photo bfile;
5 b_photo blob;
6 begin
7 update sh_photo set picture=empty_blob()
8 where catalogn=p_catalogn
9 return picture into b_photo;
10 f_photo := bfilename('photos',p_photo);
11 dbms_lob.fileopen(f_photo,dbms_lob.file_readonly);
12 dbms_lob.loadfromfile(b_photo,f_photo,dbms_lob.get length(f_photo));
13 dbms_lob.fileclose(f_photo);
14 commit;
15 end insert_img;
16
17 /
Procedure created.
SQL> commit;
Commit complete.
SQL> execute insert_img(1,'Animallandscape.jpeg');
BEGIN insert_img(1,'Animallandscape.jpeg'); END;
*
ERROR at line 1:
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 504
ORA-06512: at "APPS.INSERT_IMG", line 11
ORA-06512: at line 1