Hello All,
Below code hangs and coming out at all. I commented out the UPDATE part and did a dbmsout but even hanging for ever.
are there any performance problems..
declare
c clob;
type tt_id is table of vega.id%type;
type tt_val1 is table of vega.val1%type;
type tt_val2 is table of vega.val2%type;
type tt_row_id is table of rowid;
t_id tt_id;
t_val1 tt_val1;
t_val2 tt_val2;
t_row_id tt_row_id;
type rr is record
(id vega.id%type,
col varchar2(32000)
);
type tt_rr is table of rr index by pls_integer;
g_vega tt_rr;
v varchar2(32000);
begin
--for rec in ( select id, val1 from vega where mod(id,4) in (0,1) ) loop
-- Table vega got 100 rows ..
-- Lob is created inline ( enable stoare in row)
select rowid,id,val1,val2
bulk collect into t_row_id, t_id,t_val1,t_val2
from vega
where mod(id,4) in (0,1);
for i in t_row_id.first..t_row_id.last loop
dbms_output.put_line('Start: '||sysdate);
v := dbms_lob.substr(t_col_val(i),dbms_lob.getlength(t_val1(i)),1);
dbms_output.put_line('end: '||sysdate);
end loop;
/*
FOR j in t_row_id.first..t_row_id.last loop
update vega
set val2 = t_val1(j)
where rowid = t_row_id(j);
returning t_val1(j) into c;
end loop;
commit;
*/
exception
when others then
dbms_output.put_line(sqlerrm);
end;
Below code hangs and coming out at all. I commented out the UPDATE part and did a dbmsout but even hanging for ever.
are there any performance problems..
declare
c clob;
type tt_id is table of vega.id%type;
type tt_val1 is table of vega.val1%type;
type tt_val2 is table of vega.val2%type;
type tt_row_id is table of rowid;
t_id tt_id;
t_val1 tt_val1;
t_val2 tt_val2;
t_row_id tt_row_id;
type rr is record
(id vega.id%type,
col varchar2(32000)
);
type tt_rr is table of rr index by pls_integer;
g_vega tt_rr;
v varchar2(32000);
begin
--for rec in ( select id, val1 from vega where mod(id,4) in (0,1) ) loop
-- Table vega got 100 rows ..
-- Lob is created inline ( enable stoare in row)
select rowid,id,val1,val2
bulk collect into t_row_id, t_id,t_val1,t_val2
from vega
where mod(id,4) in (0,1);
for i in t_row_id.first..t_row_id.last loop
dbms_output.put_line('Start: '||sysdate);
v := dbms_lob.substr(t_col_val(i),dbms_lob.getlength(t_val1(i)),1);
dbms_output.put_line('end: '||sysdate);
end loop;
/*
FOR j in t_row_id.first..t_row_id.last loop
update vega
set val2 = t_val1(j)
where rowid = t_row_id(j);
returning t_val1(j) into c;
end loop;
commit;
*/
exception
when others then
dbms_output.put_line(sqlerrm);
end;