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,所以不是很懂,麻烦懂的告诉下,谢谢。
解决方案 »
- 请问我的超简单rman备份脚本运行 为何老报一个错
- 怎样从数据库中跨网传递一个简单的windows消息?
- 启动OEM,如何“登录到Oracle Management Server"?
- 存储过程中insert into 时多条件的问题,急急急!!!
- 在Oracle 存储过程中,游标打开后,怎么得到记录数?
- ☆☆☆☆☆大家积极支持参与CSDN Oracle电子杂志编辑工作☆☆☆☆☆
- 请看下面SQL语句,如何提高效率,畅所欲言,在线讨论!!!
- Oracle9i的启动和关闭方法?
- 如何把一个文本文件恢复到oracle数据库中 着急!各位大虾帮帮忙!
- 请问各位 传统dba和etl 这2个职位有什么区别?
- 请教个oracle sql 写法?
- 这个等待是什么啊Streams AQ: waiting for time management or cleanup tasks
在update语句中,使用保存拼接好的字符串变量来给字段更新值。