Sign-up....

新手求问:如何实现这个触发器

我要实现这样一个功能,在A表中插入一行新的数据时,将B表中的和A表中刚插入的这一行的数据中相同列值的那一行的其中的一个值加1。

这个我想用触发器实现,不知道该如何实现。我自己写了一个,但是老是提示编译错误。各位大侠帮我看看,是什么问题。或者重新帮我写一个。谢谢了。

CREATE or replace TRIGGER triggertest

AFTER INSERT ON teamInfo

referencing new as newone

declare

i number;

begin

i = (select havingTeam from CorpInfo

where CorpInfo.CorpID = newone.CorpID);

i++;

update carinfo

set havingTeam = i

where CorpInfo.CorpID = newone.CorpID;

end

[300 byte] By [Claire] at [2007-8-15 11:22:56]

Oracle

All Classified