Link to home
Start Free TrialLog in
Avatar of Pat Shortt
Pat Shortt

asked on

Trigger To Update A Field When Field In Another Table Is Changed

I have a mysql database and I want a Trigger To Update A Field When Field In Another Table Is Changed.

Table 1 = cases_cstm and Table 2 = Contracts
I have an End date field in both tables.
The Field name under cases_cstm is enddate_c
The field name under Contracts is end_date

I would like when a Case is created to copy the End date from Contracts to Cases
Avatar of ste5an
ste5an
Flag of Germany image

Review your model. This is redundancy at its best.
Avatar of Pat Shortt
Pat Shortt

ASKER

I don't understand your comment?
Normalization. Why copying a value at all? This value should be stored only once.
Cause I need to display the same date in 2 different views. one in Cases and one in Contracts.
SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial