CassidyHunt
IS-IT--Management
I am pulling data from a blob and for 90% of the records this works fine. However for the other 10% I get the ORA-06502 error. I know I could handle this with an exception but it kicks me out of my loop if I do that. I was wondering if there is a better way to handle blobs then what I am using.
Thanks
Cassidy
Code:
declare
-- Local variables here
i integer;
test varchar2(4000);
procedure prt(x varchar2) is
begin
dbms_output.put_line(x);
end;
begin
-- Test statements here
for a in (Select o.workorder_sub_id, o.sequence_no, o.resource_id, b.bits
from operation o, operation_binary b
where o.workorder_type = 'W'
and o.workorder_base_id = 'Q05458'
and o.workorder_lot_id = '1'
and o.workorder_split_id = '0'
and o.workorder_sub_id = 0
and o.sequence_no = 40
and b.workorder_type = o.workorder_type
and b.workorder_base_id = o.workorder_base_id
and b.workorder_lot_id = o.workorder_lot_id
and b.workorder_split_id = o.workorder_split_id
and b.workorder_sub_id = o.workorder_sub_id
and b.sequence_no = o.sequence_no
) loop
test := utl_raw.cast_to_varchar2(a.bits);
if lengthb(test) > 4000 then
test := 'No dice';
end if;
prt(a.sequence_no||' '||test);
end loop;
end;
Thanks
Cassidy