Hello,
I'm in trouble with this case:
There is a table named points, with this fields (primary key showed as *):
*product
*initial_date
final_date
points
Where a record means that a product has n points from initial_date to final_date (if final_date is null that means that is the last point assignement for the product).
I need to create a trigger on update points column, so if I change the value, trigger must update also final_date (null to sysdate-1), and create a new record for the same product with sysdate as initial and the new value for points.
I've tried different ways in order to avoid mutating tables, but surely I'm doing something wrong. Can anyone help me? Thanks!
Rod.
I'm in trouble with this case:
There is a table named points, with this fields (primary key showed as *):
*product
*initial_date
final_date
points
Where a record means that a product has n points from initial_date to final_date (if final_date is null that means that is the last point assignement for the product).
I need to create a trigger on update points column, so if I change the value, trigger must update also final_date (null to sysdate-1), and create a new record for the same product with sysdate as initial and the new value for points.
I've tried different ways in order to avoid mutating tables, but surely I'm doing something wrong. Can anyone help me? Thanks!
Rod.