trigger编译无法通过。代码如下:
CREATE OR REPLACE TRIGGER biud_sp_info
BEFORE INSERT OR UPDATE ON sp_info
FOR EACH ROW
BEGIN
IF NEW.sp_code IN (SELECT sp_code FROM sp_info) THEN
Error(-200001, ‘You must make sure THE sp_code DISTINCT.’);
END IF;
END;
------解决方法--------------------------------------------------------
‘You must make sure THE sp_code DISTINCT.’
是中文字符。改成:
'You must make sure THE sp_code DISTINCT. '
即可
------解决方法--------------------------------------------------------
NEW.sp_code前漏了冒号“:”