declare
  order_total2 number;
begin
  for i in 1..30 loop
    select sum(plpdf_demo_order_items.unit_price) into order_total2 from plpdf_demo_order_items where plpdf_demo_order_items.order_id = i;
    update plpdf_demo_orders set order_total = order_total2 where plpdf_demo_orders.order_id = i;
  end loop;
  commit;
end;