Re: Totals with Oracle Forms

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Mon, 8 Nov 2004 06:32:25 -0500
Message-ID: <Wo2dnSTbq-rMxBLcRVn-3Q_at_comcast.com>


"Elie Constantine" <elie.constantine_at_gmail.com> wrote in message news:dbf4f502.0411080026.1fb10a9d_at_posting.google.com...
| When I write the following code:
|
|
| UPDATE xxp_receiving_header SET rcv_amount = x_Amount
| WHERE xxp_receiving_header.header_id = :XXP_RECEIVING_HEADER.HEADER_ID;
|
| UPDATE xxp_receiving_header SET free_rcv_amount = x_Free_Amount
| WHERE xxp_receiving_header.header_id = :XXP_RECEIVING_HEADER.HEADER_ID;
|
| :XXP_RECEIVING_HEADER.RCV_AMOUNT := x_Amount;
| :XXP_RECEIVING_HEADER.FREE_RCV_AMOUNT := x_Free_Amount;
|
| I got Receord Has been updated by another user....
|
| When I write only this:
| UPDATE xxp_receiving_header SET rcv_amount = x_Amount
| WHERE xxp_receiving_header.header_id = :XXP_RECEIVING_HEADER.HEADER_ID;
|
| UPDATE xxp_receiving_header SET free_rcv_amount = x_Free_Amount
| WHERE xxp_receiving_header.header_id = :XXP_RECEIVING_HEADER.HEADER_ID;
|
| I don't see the changes on the form
|
|
| Help please...
|
| Thanks
| Elie,
|

your update statements are 'the other user'

if you do direct DML against the table a block is based on, forms is unaware of the 'legal' changes that your code has made and behaves as if another user has issued the updates. unfortunately, forms does not have an elegant mechanism for resolving the apparent conflict, it just prevents the operation with the error message that you see.

as i recall, this happens in the event covered by the ON-LOCK trigger -- but it's not real easy to reliably change the behavior via that trigger, since it is called at unexpected times and not called when one would expect it to be called

some options are
[_] re-querying to set the header items after the update (as noted by Frank Piron)
[_] setting the values before issuing the forms commit (and not doing explicit updates, but letting forms do the updates) [_] using non-base-table items to hold/display the amounts [_] possibly working with the SYSTEM.RECORD_STATUS and SYSTEM.BLOCK_STATUS variables to,

++ mcs Received on Mon Nov 08 2004 - 12:32:25 CET

Original text of this message