variables in this loop procedure [message #443431] |
Mon, 15 February 2010 14:24  |
pyscho
Messages: 134 Registered: December 2009
|
Senior Member |
|
|
PROCEDURE CALCULATE_CASH_REBAL( P_Account_id IN VARCHAR2,
P_Txn_Ccy IN VARCHAR2,
P_Allocation IN VARCHAR2,
l_lty_id IN VARCHAR2 ) IS
l_balance_fmt NUMBER := 0;
BEGIN
FOR CASH_TXNS IN ( SELECT *
FROM PF.PF_CASH_TXNS
WHERE ACCOUNT_ID = P_Account_Id
AND TXN_CCY = P_Txn_Ccy )
LOOP
l_balance_fmt := l_balance_fmt + CASH_TXNS.AMT;
-- update other fields like this too.
END LOOP;
END CALCULATE_CASH_REBAL;
it should be updating l_balance_fmt field for all the records in the loop. my question is when it loops to the next cash txn record, will it take the previous value of l_balance_fmt ? it should start again and take 0 as the balance_fmt and add to that..
i havent got data to test it yet, and thought id ask here and also to check if im doing it right
|
|
|
|
Re: variables in this loop procedure [message #443437 is a reply to message #443433] |
Mon, 15 February 2010 14:49   |
pyscho
Messages: 134 Registered: December 2009
|
Senior Member |
|
|
BlackSwan wrote on Mon, 15 February 2010 14:38> it should start again and take 0 as the balance_fmt and add to that..
When or under what conditions should BALANCE_FMT get reset to 0?
After a CASH_TXNS entry has been processed in the loop
|
|
|
|