cursor in condition rule(if..elsif...end if;) [message #4489] |
Sat, 14 December 2002 11:35 |
medoc
Messages: 3 Registered: December 2002
|
Junior Member |
|
|
DECLARE
alert number;
luck integer(1);
cursor ailec is
select metric_no
from register_stident;
metrik ailec%ROWTYPE;
cursor iomega is
select course_code
from register_stident;
subject iomega%ROWTYPE;
BEGIN
open ailec;
loop
fetch ailec into metrik;
exit when ailec%NOTFOUND;
If ailec%FOUND then --if metric no found
open iomega;
loop
fetch iomega into subject;
exit when iomega%NOTFOUND;
if iomega%FOUND then --if course_code found
alert := show_alert('success');
luck := 0;
while luck < 1 loop
--if cursor same with :block_course.course_code
if (subject.course_code = :block_course.course_code) then
alert := show_alert('part1');
--if cursor not same with :block_course.course_code
elsif(subject.course_code !=:block_course.course_code)
then
alert := show_alert('part2');
commit;
end if;
alert := show_alert('part3');
luck = luck + 1;
end loop;
end if;
end loop;
end if;
end loop;
Close ailec;
close iomega;
END;
i have difficulty to enable the cursor fall into if...elsif...end if condition.pls help me.
can one trigger have two or more cursor?the reason i have two cursor because, i want the program to exit if either metric_no or course_code not found. pls advice!
|
|
|
|