Use templating in mysql