I am trying to learn Oracle forms (v6.0). In a when-button-pressed trigger I am trying to loop through all of the records from a datablock. So far I have following code:
BEGIN
GO_BLOCK('MY_BLOCK');
FIRST_RECORD;
LOOP
MESSAGE(:MY_BLOCK.DSP_NAME);
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;
END LOOP;
END;
When I run the code all the DSP_NAME values are displayed except the last one. If I add :
MESSAGE(:MY_BLOCK.DSP_NAME);
after the loop, then the DSP_NAME value of the last record is displayed. Why it is like that - the message is displayed before the last record check? and what would be the right way to loop through the records?
Your loop is correct. I suspect the last message is showing up in the status bar at the bottom of the form instead of as a popup window.
To get a pop up window use the same line twice :
MESSAGE(:MY_BLOCK.DSP_NAME);
MESSAGE(:MY_BLOCK.DSP_NAME);
You'll get it this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With