Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: update from two tables
OK - here is a snapshot of the relevant data...
IM Table - 15K rcds
IM_KEY (Unique) (varchar2,30)
IM_ALLOC (number,7,0)
{other non-relevant fields}
RQ Table - 168K rcds
RQ_IMKEY (varchar2,30) RQ_QTY_REQ (number,7,0) RQ_MOCNUMBER (varchar2,30)
RQ Data
RQ_MOCNUMBER RQ_IMKEY RQ_QTY_REQ
A0111052 ASLAN4 5 A0111052 ASRAB1 8 A0111052 RS325 3 A0111058 ASLAN4 3 A0111058 ASRAB1 6 A0111058 RS325 2 A0111058 SPAD32 8
IM Data
IM_KEY IM_ALLOC ASLAN1 32 ASLAN4 27 ASRAB1 12 RS324 15 RS325 18 SPAD31 12 SPAD32 4
So, if I wanted to update for A0111058, I need IM_ALLOC to reflect the new data as follows:
IM_KEY IM_ALLOC(old) IM_ALLOC(new) ASLAN4 27 30 ASRAB1 12 18 RS325 18 20 SPAD32 4 12
So, I need the query to *only* update the 4 relevant records, and obviously a table scan gets a bit hairy with the size of my table(s).
Hope this helps - it should be soooo simple, no?? But it is driving me nuts!!
Jerry
{SNIP SNIP SNIP SNIP SNIP}
Received on Thu Aug 01 2002 - 07:01:25 CDT