10 lines
265 B
MySQL
10 lines
265 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`town_beforeInsert`
|
||
|
BEFORE INSERT ON `town`
|
||
|
FOR EACH ROW
|
||
|
BEGIN
|
||
|
SET NEW.geoFk = zoneGeo_new('town', NEW.`name`,
|
||
|
(SELECT geoFk FROM province WHERE id = NEW.provinceFk));
|
||
|
END$$
|
||
|
DELIMITER ;
|