CREATE OR REPLACE TRIGGER TRI_AAA
BEFORE INSERT ON AAA
FOR EACH ROW
DECLARE NCOUNT NUMBER(4)
BEGIN
SELECT COUNT(*) INTO NCOUNT FROM BBB WHERE C_NAME=:NEW。C_NAME
IF NCOUNT>0
INSERT INTO DDD(C_BH)VALUES(NCOUNT)
END IF
END;
我这个触发器在你的帮助下可以用了呀,不过还有一点小问题就是我是在往AAA表里增加数据时触发,为何执行之后数据也增加到AAA表中呀,还有一个问题就是我用INTERBASE写的SQL语句怎样把它改为ORACLE语句呀
SELET CAST(SUM(SH) AS VARCHAR(20)BBB),CAST(NULL AS VARCHAR(20)CCC) FROM TABLE1 UNION SELET CAST(SUM(SH) AS VARCHAR(20)BBB),CAST(NULL AS VARCHAR(20)CCC) FROM TABLE1我怎样把它变为ORACLE数据库的SQL语句呀CAST在ORACLE用什么取代呀
--------------------next---------------------
阅读(1250) | 评论(0) | 转发(0) |