my table has about 600 000 rows and I'm triyng
to update some values in it.
first, I tryed to do it by cursor
cursor v_artikl_ducan is select sifra_artikla, ducan from
sum_artikli_mjesec_nova for update;
for i in v_artikl_ducan loop
update sum_artikli_mjesec_nova
set (kolicina_zg, mpv_zg, mpv_bez_pdv_zg, nv_zg, bm_zg)=
(select sum(p.kolicina) kolicina_zg,
sum(p.mpv) mpv_zg,
sum(p.mpv_bez_pdv) mpvn_zg,
sum(p.nv) nv_zg,
sum(p.bm) bm_zg
from tblprodaja p
where p.sifra_artikla=i.sifra_artikla and
p.datum>=to_date('01.12.2001','DD.MM.YYYY') and
p.datum< to_date('01.01.2002','DD.MM.YYYY') and
p.ducan=i.ducan and
p.regija='ZG')
where current of v_artikl_ducan;
commit;
end loop;
when this returning error ORA-01555, I tryed to do this:
update sum_artikli_mjesec_nova m
set (kolicina_zg, mpv_zg, mpv_bez_pdv_zg, nv_zg, bm_zg)=
(select sum(p.kolicina) kolicina_zg,
sum(p.mpv) mpv_zg,
sum(p.mpv_bez_pdv) mpvn_zg,
sum(p.nv) nv_zg,
sum(p.bm) bm_zg
from tblprodaja p
where p.sifra_artikla=m.sifra_artikla and
p.ducan=m.ducan and
p.datum>=to_date('01.12.2001','DD.MM.YYYY') and
p.datum< to_date('01.01.2002','DD.MM.YYYY') and
p.regija='ZG');
and this query also raturns the same error.
Rollback segments have inital size 512, next size 512 and maximum
number value 4096.
But I think that theese queries should work with this values.