Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: update statement PL/SQL
Reallybig wrote:
> I'm a newbie here. I try to update data from 1 table from another
> table. So I used cursor to update my employee table on Total_sale
> column = amount column on Sales Table where employee.empid =
> sales.empid. The problem is for 700,000, it took 2 hours to update.
> That's too long. Any Ideas or some sample codes would really
helpful.
>
> Thanks
Hopefully this is some kind of data warehouse, in which case you should look into materialized views.
If it is OLTP, use a regular view.
If all else fails.
update emp set total_sale =
(
select sum(amount) from sales
where sales.empno = emp.empno
)
-- MJBReceived on Wed Apr 27 2005 - 21:15:50 CDT