--DROP TRIGGER tr_i_game;

DELIMITER |

CREATE TRIGGER tr_i_game BEFORE INSERT ON game
FOR EACH ROW BEGIN
insert into game_square 
select concat(concat(NEW.game_nm,"-"), cast(gts.square_id as char(2))), NEW.game_nm, square_id, square_value, "#given#"
from game_template_square gts
where gts.game_template_id = NEW.game_template_id;
END;
|