Re: Oracle Forms Question
Date: 1995/04/27
Message-ID: <3no799$qt0_at_geraldo.cc.utexas.edu>#1/1
>I am new to Oracle Forms programming, and I hope somebody can
>help me with the problem I face. I am working with Forms 4.0 .
>
>I have a block in which table of empoyees is displayed (with
>vertical scrollbar). I wish to add a push button control, pressing
>on which will scroll the table, and bring the current record to
>be THE EMPLOYEE WITH THE HIGHEST SALARY DISPALYED NOW IN THE BLOCK.
>
>This should be done wihtout asking from the user to enter any query.
>Scrolling records in the table one-by-one is not acceptable solution.
>
>Yes, I know about GO_RECORD(line_number), but how can I find the
>number of required record? Is there any way to loop over all the
>records in the current block?
>
Try something like this
max_sal NUMBER :=0;
max_sal_record_num NUMBER :=1;
GO_BLOCK('..employees...');
FIRST_RECORD;
LOOP
IF (:employee.salary > max_sal) THEN
max_sal := :employee.salary; max_sal_record_num := :system.cursor_record;END IF;
EXIT WHEN (:system.last_record ='TRUE'); NEXT_RECORD;
END LOOP;
GO_RECORD(max_sal_record_num); Received on Thu Apr 27 1995 - 00:00:00 CEST