first_record loop through an LOV [message #195226] |
Wed, 27 September 2006 08:20 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ChrisCash
Messages: 2 Registered: September 2006
|
Junior Member |
|
|
I have a multi-block form with master-detail relationships. A unique value (contract_no) is called via a LOV which populates the various other blocks. Within this form I have a push button that runs a calculation and populates a new table with the results based on the unique contract_no that is passed in by the LOV.
This works fine for the individual records but what I need to do is to perform the calculation for every contract_no within the contracts table in one loop.
I have written the following code behind a new push button. I think the problem is that this wont work because as the contract_no is unique (which is passed in by the LOV) the first and last record will be the same because the form only sees the unique contract_no.
first_record;
LOOP
--do the calculations here
IF (:system.Last_record = 'TRUE') THEN
EXIT;
ELSE next_record;
END IF;
END LOOP;
COMMIT;
Hope this makes some sense,
Any help would be great
|
|
|
Re: first_record loop through an LOV [message #195475 is a reply to message #195226] |
Thu, 28 September 2006 22:41 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Why not use an 'update' statement and modify the existing records in the database all in one go. Less network traffic and much, much faster.
David
|
|
|