Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trigger /rules/agregate which one to use?

Status
Not open for further replies.

JJJ777

Programmer
Jun 5, 2002
33
0
0
MY
hi all....

this is my table :

TABLE 1: exam
subject |id | paper_1 |paper_2|total| gred|point
---------+---|---------+-------+-----|----+------|
SF017 | 1 | 40 |


TABLE 2 : gred_exam

grd_id|grd_from|grd_to | grd_value |grd_point|grd_subjek
1 | 80 | 100 | A | 4.00 | SF017|


my objektif is when any update on table exam it will auto count value and store it in total where total = paper_1 + paper_2 and also auto insert the gred & point as well...

please help me ..i dont know which one to use either function trigger / rules / agregate....

here is my rules that is not working out :

create RULE count AS ON UPDATE TO exam DO UPDATE exam SET total = paper_1 + paper_2 where exam.id = exam.id and exam.subject = exam.subject

tq in advance i'm a newbies....











 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top