Articles Comments

{ Berbagi, Menulis, Dan Mengajar } Ilmu… » 7. Operating System » Trigger Copy Ubah 081 –> +6281

Trigger Copy Ubah 081 –> +6281

DELIMITER $$

USE `coba`$$

DROP TRIGGER `TriggerCopy`$$

CREATE
/*[DEFINER = { user | CURRENT_USER }]*/
TRIGGER `TriggerCopy` AFTER INSERT ON `tabel1`
FOR EACH ROW BEGIN

/*UPDATE tabel2
SET nama = REPLACE(New.Nama,’081′,’+6281′);*/

INSERT INTO coba.tabel2 (id,Nama,Alamat)
VALUE ( NEW.Id,NEW.Nama,NEW.Alamat);

UPDATE tabel2
SET nama = REPLACE(NEW.Nama,’081′,’+6281′);

END$$

DELIMITER ;

Filed under: 7. Operating System

Leave a Reply

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>