文档解释
ORA-04070: invalid trigger name
Cause: An invalid trigger name was specified.
Action: Verify that trigger name is not a reserved keyword.
这个错误表示输入的触发器名称无效。
官方解释
ORA-04070: invalid trigger name
Cause: An attempt was made to create, alter, or drop a trigger with an invalid name. A trigger name must begin with a letter, be less than or equal to 30 characters, and consist of only alphanumeric characters and the special characters $, _, and #.
Action: Enter a valid name for the trigger.
常见案例
在创建触发器时,以非字母开头的字符串将导致Ora-4070错误。例如,使用下面的脚本将创建触发器:
CREATE OR REPLACE TRIGGER &life BEFORE INSERT ON &table_name FOR EACH ROW DECLARE temp_no NUMBER(4); BEGIN SELECT seq_no.nextval INTO temp_no FROM dual; UPDATE &table_name SET cyclenumber = temp_no WHERE rowid = :OLD.rowid; END; /
出现ORA-4070错误,因其中包括一个&life触发器,它无效,因为它不以字母开头。
正常处理方法及步骤
1.重新命名触发器,使其以一个字母开头,确保它不超过30个字符,并只包含字母数字字符和特殊字符$,_和#。
2.重新编译触发器,使其生效。
3.使用ALTER TRIGGER … ENABLE语句启用触发器,以便其可以生效。