【发布时间】:2015-08-06 17:57:24
【问题描述】:
我正在尝试触发,当插入数据时,它会修剪正在插入的数据。
这是我正在尝试的..
CREATE OR REPLACE TRIGGER trig_trim
BEFORE INSERT ON triggertest
FOR EACH ROW
BEGIN
TRIM(:new.testchar);
END;
/
我做了这样的插入
INSERT INTO triggertest (testnum, testchar) VALUES (9, ' r9 ');
我收到此错误...
04098. 00000 - "trigger '%s.%s' is invalid and failed re-validation"
*Cause: A trigger was attempted to be retrieved for execution and was
found to be invalid. This also means that compilation/authorization
failed for the trigger.
*Action: Options are to resolve the compilation/authorization errors,
disable the trigger, or drop the trigger.
当我只是运行代码来创建触发器时,我得到了这个
TRIGGER TRIG_TRIM compiled
Errors: check compiler log
并在编译器日志中显示“'TRIM' 不是过程或未定义”
是我的语法错误还是我的逻辑?我不知道为什么会失败。
【问题讨论】: