Home » SQL & PL/SQL » SQL & PL/SQL » Oracle Forms 6i Button Trigger
Oracle Forms 6i Button Trigger [message #616] Mon, 25 February 2002 01:10 Go 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.honours_points:=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 #620 is a reply to message #616] Mon, 25 February 2002 01:41 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
create a control item let us say count_star in students block and then write this code( i have changed your code a bit)

DECLARE
CURSOR c_l1 IS
SELECT honours_points,count(*) count_star
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;
:students.count_star:=L1_rec.count_star;
END LOOP;
END;
Previous Topic: Altering a table's tablespace
Next Topic: Trigger is failing
Goto Forum:
  


Current Time: Mon Sep 27 16:51:58 CDT 2021