Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to update cursor when cursor selects from two tables..
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
![]() |
![]() |