Home » SQL & PL/SQL » SQL & PL/SQL » Oracle Forms 6i Button Trigger
Oracle Forms 6i Button Trigger [message #612] Mon, 25 February 2002 00:30 Go to next message
Greg Horton
Messages: 37
Registered: February 2002
Member
Thanks for your repsonse. If possible, could you clarify/elaborate the "populate the record...from the cursor..." statement?

Greg
Re: Oracle Forms 6i Button Trigger [message #613 is a reply to message #612] Mon, 25 February 2002 00:35 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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
Re: Oracle Forms 6i Button Trigger [message #622 is a reply to message #618] Mon, 25 February 2002 01:49 Go to previous message
Greg Horton
Messages: 37
Registered: February 2002
Member
Thanks v much - i had actually just coded those same commands as you emailed me.

Cheers,

Greg
Previous Topic: Trigger is failing
Next Topic: Clear Form Trigger
Goto Forum:
  


Current Time: Wed Apr 24 13:41:50 CDT 2024