Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: update statement PL/SQL

Re: update statement PL/SQL

From: <pobox002_at_bebub.com>
Date: 27 Apr 2005 19:15:50 -0700
Message-ID: <1114654550.179813.134900@f14g2000cwb.googlegroups.com>


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
    )

-- 
MJB
Received on Wed Apr 27 2005 - 21:15:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US