Dear
I have a trigger in a Form (When-Button-Pressed) i want to use this Trigger on a button on Report runtime My tigger is
DECLARE
CURSOR C1 IS
SELECT NEW.CID,NEW.SNO,NEW.MT,GS.GP,GS.GRADE,c.CRHOURS chr, GS.GP*c.CRHOURS tp
FROM GRADING_SYSTEM GS,myclass my,course c,(
SELECT CA.CID,CA.SNO,CEIL(NVL(SUM(CA.MARKS),0)) MT
FROM STCA CA,ASST M
WHERE CA.AID = M.ID
AND M.T='Y'
AND CA.CID = :myclass.id
GROUP BY CA.CID,CA.SNO) NEW
WHERE NEW.MT = GS.NO
and new.cid = my.id
and my.cno = c.id;
C2 C1%ROWTYPE;
ATC NUMBER;
tp number(5,5):=0;
BEGIN
Set_Alert_Property('A1', ALERT_MESSAGE_TEXT, 'After grading, this class will be locked. Do you really want to grade class?');
atc :=show_alert('a1');
if atc=alert_button1 then
update myclass
set LOCK_STATUS = 'LOCKED'
WHERE ID = :MYCLASS.ID;
COMMIT;
OPEN C1;
LOOP
FETCH C1 INTO C2;
EXIT WHEN C1%NOTFOUND;
UPDATE STCLASS
SET TOTAL=C2.MT,GRADE=C2.GRADE,POINT=C2.GP ,CRHOURS = c2.chr,tpoint = c2.tp
WHERE STCLASS.SNO = C2.SNO
AND STCLASS.CID = C2.CID
and (stclass.grade In('A','B','C','B+','C+','F')OR STCLASS.GRADE IS NULL);
END LOOP;
COMMIT;
CLOSE C1;
GO_BLOCK('ASST_DEF');
EXECUTE_QUERY;
---------
-----------------
Set_Alert_Property('A2', ALERT_MESSAGE_TEXT, 'CLASS HAS BEEN GRADED AND LOCKED');
atc :=show_alert('a2');
Set_Item_Property('MYCLASS.P_GRADE',ENABLED,PROPERTY_FALSE);
else
message('OK..........!');
end if;
end;
Can i use this on a Report if yes pleae tell me the procedure.
Thanks
Insert Form Trigger in a Report
Who is online
Users browsing this forum: No registered users and 8 guests