Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loop through all the records of datablock in Oracle forms

Tags:

forms

oracle

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?

like image 924
skujins Avatar asked Feb 19 '13 18:02

skujins


2 Answers

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.

like image 124
GriffeyDog Avatar answered Oct 03 '22 09:10

GriffeyDog


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.

like image 23
Ameer Usman Avatar answered Oct 03 '22 10:10

Ameer Usman