-
Contributing Member
doubt in LOB
LOB
i want doubt in lob concept
i created one procedure in lob
that is sucess but i having run error came.
i sent following procedure and error also
create or replace procedure load_pic(p_file varchar2)
is
v_file bfile;
v_filename varchar2(27);
cursor emp_pic is select id from id_pic;
id_rec id_pic%rowtype;
begin
for id_rec in emp_pic loop
v_filename :=id_rec.id|| '.jpg';
v_file:=bfilename(p_file,v_filename);
dbms_lob.fileopen(v_file);
update id_pic set photo=v_file;
DBMS_OUTPUT.PUT_LINE('LOADED FILE: '||v_filename
|| ' SIZE: ' || DBMS_LOB.GETLENGTH(v_file));
dbms_lob.fileclose(v_file);
end loop;
end load_pic;
error
create table id_pic(id number,photo bfile);
create directory pic_dir as 'E:\pic';
SQL> execute load_pic('pic_dir');
BEGIN load_pic('pic_dir'); 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 "SCOTT.LOAD_PIC", line 11
ORA-06512: at line 1
-
Re: doubt in LOB
For bfilename you need to pass two parameters.
1st---name of the directory created
2nd---name of the file
to create a directory please use CREATE DIRECTORY command.
-
Junior Member
Re: doubt in LOB
Hello
Can any one say what is relational testing?? Is this term really exist or not??????????
-
Contributing Member
Re: doubt in LOB
i already create directory
bfile is use directory and automatic idno then
procedure using only one parameter that is directory name
but i do not kown error
-
Junior Member
Re: doubt in LOB
Either you did not create and directory from which u r picking the image or there is need to give permission on the directory u r using or the file u r opening could not be opened successfully.
-
Re: doubt in LOB
Do you have read ,write permission on the directory ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules