大体意思是有一张用户表跟一张主帖表
当主帖表插入一行记录时,通过对应用户表里面的user_id的user_score跟user_gold字段增加
用触发器完成,以下是错误信息
1 create or replace trigger tri_user_topic
2 after insert on t_topic
3 for each row
4 begin
5 update t_user set user_score=user_score+5 and user_gold=user_gold+2 where t_user.user_id=new.user_id;
6* end;
SQL> /警告: 创建的触发器带有编译错误。SQL> show error
TRIGGER AI_USER_TOPIC 出现错误:
PL/SQL: SQL Statement ignored
PL/SQL: ORA-00933: SQL 命令未正确结束
update t_user set user_score=user_score+5 , user_gold=user_gold+2 where ....
update t_user set user_score=user_score+5 ,user_gold=user_gold+2 where t_user.user_id=:new.user_id;
after insert on t_topic
for each row
begin
update t_user set user_score=user_score+5 an, user_gold=user_gold+2 where t_user.user_id=new.user_id;
end;