需求:
goods货物表,字段id主键,price价格,counts销售数量
trade交易记录表,字段id主键,g_id货物标识。
如果交易表中添加一条记录,则goods中对应trade表中的g_id的id的销售数量加1建表表语句:
--货物表
create table goods(id number primary key,price number,counts number);
--交易记录表
create table trade(id number primary key,g_id number);
--添加外键
alter table trade add constraint g_id_fk  foreign key (g_id) references goods(id);
--创建序列1
create sequence first_seq increment by 1 start with 1 maxvalue 9999999 nocache;
--创建序列2
create sequence first2_seq increment by 1 start with 1 maxvalue 9999999 nocache;插入测试记录:
insert into goods(id,price,counts) values(first_seq.nextval,20,10);
insert into trade(id,g_id) values(first2_seq.nextval,56);触发器:
drop trigger g_t;
create trigger g_t
after insert on trade
for each row
begin
update goods  set counts=(counts+1) where id=:g_id;
end;但是建触发器显示---[警告: 创建的触发器带有编译错误]

求指导,正确的触发器怎样写,谢谢!