I am tring to copy data from clob col. to blob col. the code for that is written as below.

declare
a number;
v_blob blob := empty_blob();
amount binary_integer;
offset integer;
buffer varchar2(32000);
buffer2 raw(32000);
cursor c1 is select address ,add2, rowid from xyz for update;
begin
for i in c1
loop
select add2 into v_blob from xyz where rowid = i.rowid;
a := dbms_lob.getlength(i.address);
DBMS_LOB.READ ( i.address, a, 1, buffer);
buffer2 := utl_raw.cast_to_raw(buffer);
DBMS_LOB.WRITE(v_blob, utl_raw.length(buffer2), 1, buffer2);
update xyz set add2 = v_blob where rowid=i.rowid;
end loop;
end;

But getting folloing errors
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified:
ORA-22275
ORA-06512: at "SYS.DBMS_LOB", line 767
ORA-06512: at line 16

What is error cause.

Thanks