create or replace trigger community_trigger  after insert or update or delete
on community for each row
begin   if inserting then   
Insert into users(username,passwd,permit,org)  values((select DISTINCT init from county where  county_name=:NEW.county)||:NEW.code||'02',(select DISTINCT init from county where county_name=:NEW.county)  || :NEW.code ||  '02' || '888' ,65, :NEW.hos_name);

   elsif updating then
Update users  set   Update users  set  
username=(select DISTINCT init from county where county_name=:NEW.county) || :NEW.code  || '02',
 passwd=(select DISTINCT init from county where county_name=:NEW.county) || :NEW.code || '02' ||  '888',
org=:NEW.hos_name
Where username=(select DISTINCT init from county where county_name=:OLD.county) || :OLD.code || '02';    elsif deleting thenDelete from users where username=(select DISTINCT init from county where county_name=:OLD.county) || :OLD.code ||'00';

       end if;end;
问题主要是出在update进行字符串拼接的时候,老是提示SQL命令未正确结束,由于新学的sql,所以不是很懂,麻烦懂的告诉下,谢谢。