I have a database that consists of two tables, table A and table B. These two tables are joined in a view.
There are a couple fields in table A that I need to calculate values for everytime an entry is updated. The reason im using a trigger is b/c these calculated fields get there values from a formula that consists of fields from both tables.
Not only that but I need to decipher what kind of formula to use by querying the database and finding out if 1 of 3 conditions is true. If so, use that specific formula. Below is some pysdo code...
update trigger
if condition1 then
x = b+c+d+e/r
y = x+2
endif
if condition2 then
x = m+c+d+e/r
y = x+4
endif
if condition3 then
x = g+c+d+e/r
y = x+5
endif
There are a couple fields in table A that I need to calculate values for everytime an entry is updated. The reason im using a trigger is b/c these calculated fields get there values from a formula that consists of fields from both tables.
Not only that but I need to decipher what kind of formula to use by querying the database and finding out if 1 of 3 conditions is true. If so, use that specific formula. Below is some pysdo code...
update trigger
if condition1 then
x = b+c+d+e/r
y = x+2
endif
if condition2 then
x = m+c+d+e/r
y = x+4
endif
if condition3 then
x = g+c+d+e/r
y = x+5
endif