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

Home -> Community -> Usenet -> c.d.o.misc -> Iteration-Problem

Iteration-Problem

From: Alex <dead.man.walking_at_gmx.de>
Date: 24 Oct 2006 06:06:13 -0700
Message-ID: <1161695173.099633.259640@k70g2000cwa.googlegroups.com>


Hello NG,

I've got the following problem:
I've to calculate certain values (70) and write them into a table. Because the calculation includes INSERTS of non-existing values as well as UPDATES (re-calculations) of existing values, it's a time-munching operation.

To perform the mentioned operations, I'm using a MERGE-statement and restrict the amount of datsets with a pair fo date-params. MERGE INTO ...
USING( SELECT ... FROM ... WHERE date_value BETWEEN dt_param1 AND dt_param2 )

But even now, there are far too many datasets left, to do process the operation within reasonable time.
At the moment, I've to live with that...

BUT:
In some cases, I'd realy like to speed up the process by just inserting  a given few and re-calculate just those, who depend on these.

Question:
Can I use the following:
MERGE INTO TAB_B
USING ( SELECT * FROM TAB_A TA

        WHERE NOT EXISTS ( SELECT 'x' FROM TAB_B TB
                           WHERE TA.KEY = TB.KEY )

I'm not sure if I can actually use such statement. It might be permitted (cannot check now, due to running transaction) or produce something bad...

Can anybody tell me, if this is allowed or - even better - if there is a better way to accomplish the restriction?

Any help will be appreciated

Alex Sauer Received on Tue Oct 24 2006 - 08:06:13 CDT

Original text of this message

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