I have a Depts table with two columns, and ID and a name. Here's a sample:
DeptID DeptName
12333 Office
12500 Warehouse
12501 Warehouse
I also have an Employees table, and each employee row has a DeptID column.
What I want to do is create a rule/constraint that will, for example, automatically convert the value of 12501 to 12500 for each employee in the Employees table (current and new). Then I can remove the 12501 row from the Depts table.
I hope I explained that well enough. It doesn't seem like a rule or constraint can actually do that, but maybe a trigger could, I have no experience with triggers.
DeptID DeptName
12333 Office
12500 Warehouse
12501 Warehouse
I also have an Employees table, and each employee row has a DeptID column.
What I want to do is create a rule/constraint that will, for example, automatically convert the value of 12501 to 12500 for each employee in the Employees table (current and new). Then I can remove the 12501 row from the Depts table.
I hope I explained that well enough. It doesn't seem like a rule or constraint can actually do that, but maybe a trigger could, I have no experience with triggers.