有些复杂,有劳了
CREATE OR REPLACE TRIGGER ticc
AFTER INSERT ON t_user_kind
FOR EACH ROW
DECLARE
VID NUMBER(3,0);
VNAME VARCHAR2(20);
VFOUND NUMBER(1,0);
BEGIN
VFOUND:=-1; 从这句开始报错
SELECT COUNT(*) INTO VFOUND FROM T_USER_KIND1 WHERE T_USER_KIND1.NAME_USERKIND =:NEW.NAME_USERKIND;
IF VFOUND>0 THEN
SELECT id_userkind,NAME_userkind INTO VID,VNAME FROM T_USER_KIND1
WHERE T_USER_KIND1.NAME_USERKIND =:NEW.NAME_USERKIND;
INSERT INTO T_USER_KIND2 VALUES(VID, VNAME,:NEW.id_userkind, :NEW.name_userkind);
DELETE FROM t_user_kind WHERE t_user_kind.id_userkind=:NEW.id_userkind;
END IF;
END;