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: How to update cursor when cursor selects from two tables..

Re: How to update cursor when cursor selects from two tables..

From: Tony Andrews <andrewst_at_onetel.com>
Date: 2 Nov 2004 06:54:06 -0800
Message-ID: <1099407246.390675.80140@c13g2000cwb.googlegroups.com>


Michal Szymanski wrote:
> But row is not updated, why? Is it possible to update if cursor
select
> from two or more tables

You need to tell Oracle which table you will be updating in the FOR UPDATE clause:

/* Cursor for browsing contract-repayment tables */ CURSOR c_contract_repayment IS
SELECT c.new,r.status FROM contract c
LEFT OUTER JOIN repayment_schedule r ON c.contract_id = r.contract_id

WHERE c.NEW = HIB_BOOL_TRUE
AND c.aggregated = HIB_BOOL_FALSE and
rownum<COMMIT_AFTER_NO_TRAN
      FOR UPDATE OF c.aggregated;
Received on Tue Nov 02 2004 - 08:54:06 CST

Original text of this message

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