Another solution is a stored procedure:
DELIMITER |
CREATE PROCEDURE prc_update_airport_name (c char(3), n varchar(255))
BEGIN
UPDATE airport_code
SET airfield_name = n
WHERE code = c;
UPDATE flight_denorm
SET from_airfield_name = n
WHERE from_airport = c;
UPDATE flight_denorm
SET to_airfield_name = n
WHERE to_airport = c;
END
|
DELIMITER ;
Use like:
CALL prc_update_airport_name('AMS', 'Schiphol');