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....
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....