我正在尝试将 Oracle 触发器移植到 MySQL。触发器中有一个EXCEPTION WHEN OTHERS
语句,虽然我找到了其他所有内容的等效语句,但我找不到这个。触发器类似于:
IF (yada yada)
THEN
BEGIN
SELECT a
INTO generic_variable1
FROM table
WHERE condition;
SET generic_variable2 = value1;
EXCEPTION WHEN OTHERS --this part needs to be replaced by valid MySQL syntax
SET generic_variable2 = value2;
END;
END IF;
如何将该部分转换为 MySQL?