MySQL Forums
Forum List  »  Replication

Re: Materialized view on mysql replica.
Posted by: Miguel Alvarez
Date: December 01, 2020 11:58AM

Hi.
Yes. It is very similar. My trigger has the following code:
CREATE TRIGGER trig_ivUsuarios AFTER UPDATE ON dbname.usuarios
FOR EACH ROW BEGIN
UPDATE vUsuarios SET apellido1 = NEW.paterno,
apellido2 = NEW.materno,
fecha_nacimiento = DATE_FORMAT(NEW.nacimiento,'%Y-%m-%d'),
fecha_registro = NEW.fecha_creacion,
genero = NEW.sexo,
nombre = NEW.nombre
WHERE id_monitor = NEW.id_usuario;
END

This trigger was created on table dbname.usuarios and updates data on materialized view vUsuarios.
Thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
142
November 30, 2020 01:31PM
Re: Materialized view on mysql replica.
55
December 01, 2020 11:58AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.