CREATE SEQUENCE emp_sequence
INCREMENT BY 1
START WITH 1
NOMAXVALUE
NOCYCLE
NOCACHE
CREATE TABLE example(
ID Number(4) NOT NULL PRIMARY KEY,
NAME VARCHAR(25),
PHONE VARCHAR(10),
ADDRESS VARCHAR(50) )
CREATE TRIGGER "emp_trigger" BEFORE
INSERT ON example FOR EACH ROW WHEN (new.id is null)
begin
select emp_sequence.nextval into: new.id from dual;
end;
执行的sql: INSERT INTO example(Name,phone,address) Values('Tom','123456','BeiJing');的时候报触发器错误,怎么解决触发器错误?
我是空的数据库,里面没有表,我就执行以上的代码,报的错误