ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified:
498603Jul 12 2006 — edited Jul 12 2006Hi:
I would like some help in resolving my problem.
I try to execute the following storage procedure :
//Laod image file to BLOB,the image6.jpg is 1.36MB
declare
l_blob blob;
l_bfile BFILE;
begin
insert into images values(6,EMPTY_BLOB()) returning image into l_blob;
l_bfile:=BFILENAME('IMG_DIR','image6.jpg);
SELECT img_id,DBMS_LOB.GETLENGTH(image) from images;
DBMS_LOB.fileopen(l_bfile);
DBMS_LOB.loadfromfile(l_blob,l_bfile,DBMS_LOB.getlength(l_bfile));
DBMS_LOB.fileclose(l_bfile);
end;
//BLOB convert to CLOB
DECLARE
l_sour_blob BLOB;
l_dest_clob CLOB;
l_lang NUMBER := DBMS_LOB.default_lang_ctx;
l_warning NUMBER;
l_t_offset NUMBER := 1;
l_src_offset NUMBER := 1;
BEGIN
SELECT image
INTO l_sour_blob
FROM images
where img_id=6;
-- convert to CLOB for display
DBMS_LOB.converttoclob (l_dest_clob,
l_sour_blob,
DBMS_LOB.lobmaxsize,
l_t_offset,
l_src_offset,
DBMS_LOB.default_csid,
l_lang,
l_warning
);
DBMS_OUTPUT.put_line (l_dest_clob);
END;
got errors as following:
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275
ORA-06512: 在 "SYS.DBMS_LOB", line 683
ORA-06512: 在 line 15
Please help me.thanks in Advance.