我的触发功能有问题(在删除之前)。 不知何故,我不断收到此错误 表格Teacher正在变异,触发器/功能可能看不到 在“ MIN_TABLE”的第4行 执行触发器“ MIN_TABLE”期间发生错误
CREATE TABLE Teachers(
id varchar2(10) primary key,
name varchar2(20) not null,
phone_no varchar2(15) not null
);
CREATE OR REPLACE TRIGGER min_table
BEFORE DELETE ON Teachers
FOR EACH ROW
DECLARE
v_count NUMBER;
BEGIN
SELECT COUNT(*) INTO v_count FROM Teachers;
IF(v_count = 1) THEN
RAISE_APPLICATION_ERROR(-20001, 'This table cannot less than one record!');
END IF;
END;
/