|
Re: Oracle Forms 6i Button Trigger [message #613 is a reply to message #612] |
Mon, 25 February 2002 00:35   |
pratap kumar tripathy
Messages: 660 Registered: January 2002
|
Senior Member |
|
|
(please answer to your old posting , instead of creating new one every time , it is lot easier)
let us say u have emp_block with the field empno and ename , the ur code should be like this
declare
cursor xyz is
select ename,empno from emp;
begin
go_block('your block');
for tmp in xyz
loop
create_record;
:emp_block.empNo:=tmp.empno;
:emp_block.ename:=tmp.ename;
end loop;
end;
|
|
|
Re: Oracle Forms 6i Button Trigger [message #618 is a reply to message #612] |
Mon, 25 February 2002 01:30   |
Greg Horton
Messages: 37 Registered: February 2002
|
Member |
|
|
I keep selecting the "Post a Reply" option and getting an error, so i have to keep re-doing each reply - sorry :-(
Thank you very much for your help, i have now managed to get it working.
The code is as shown:
DECLARE
CURSOR c_l1 IS
SELECT distinct honours_points
from students
group by honours_points
having count(*) > 1;
--
BEGIN
go_block('students');
FOR L1_rec IN c_L1
LOOP
create_record;
:students.honours_points:=L1_rec.honours_points;
END LOOP;
END;
What im now stuck on is that i want to be able to assign the count(*) values to the cursor also, so that when the button is pressed and it populates the block (students), two values are displayed - honours_points and count(*).
However, the table students, does not contain a column for count(*) as it is generated at runtime. Do you have any suggestions as to how i could assign the count(*) values to a variable so that i could populate the block in a similar way to honours_points?
:students.count_star:=L1_rec.count_star;
The above would work if i could somehow get each value of count(*) to be assigned to a variable count_star.
Thanks for your time,
Greg
|
|
|
|