MySQL DELIMITER syntax errors

前端 未结 6 874
长发绾君心
长发绾君心 2020-12-06 10:13

This MySQL script installs multiple triggers.

It works on one machine running MySQL 5.0.51b-community. On another machine running MySQL 14.12 Distrib 5.0.45, for re

6条回答
  •  孤城傲影
    2020-12-06 11:08

    In the version of MySql I use the same error occurs when using the delimiter command, but this version handles the delimiter ";" for statements and delimiter "|" for stored procedures and functions, which i think solves the problem; try this:

    DROP TRIGGER IF EXISTS trigger_name;

    CREATE TRIGGER trigger_name BEFORE UPDATE ON table FOR EACH ROW BEGIN -- Trigger logic goes here END |

    -- other statements or functions here

提交回复
热议问题