oracle触发器添加更新删除数据到相同结构临时表
来源:互联网 发布:德拉蒙德格林数据 编辑:程序博客网 时间:2024/04/30 15:24
create or replace trigger ToTemp after insert or update or delete
on info for each row
declare//声明变量
integrity_error exception;
errno integer;
begin
if inserting then
select sex into sexy from info;
insert into info_temp(ID,UserName,Sex,Status) values(:NEW.ID,:NEW.UserName,sexy);//:NEW.UserName的值为表info新增加的数据
elsif updating then
update info_temp set ID=:NEW.ID,UserName=:NEW.UserName where id=:OLD.id;
elsif deleting then
delete from info_temp where id=:OLD.id;
end if;
exception
when integrity_error then
raise_application_error(errno, errmsg);
end;
on info for each row
declare//声明变量
integrity_error exception;
errno integer;
errmsg char(200);
sexy varchar2(20);
begin
if inserting then
select sex into sexy from info;
insert into info_temp(ID,UserName,Sex,Status) values(:NEW.ID,:NEW.UserName,sexy);//:NEW.UserName的值为表info新增加的数据
elsif updating then
update info_temp set ID=:NEW.ID,UserName=:NEW.UserName where id=:OLD.id;
elsif deleting then
delete from info_temp where id=:OLD.id;
end if;
exception
when integrity_error then
raise_application_error(errno, errmsg);
end;
- oracle触发器添加更新删除数据到相同结构临时表
- 相同表结构 一个表结构插入更新删除更新同步另外一个表 触发器设计 inserted,deleted 均为系统临时表
- oracle触发器(当插入或删除或修改一张表A时,能把新数据同步到另一张结构相同的表B里面)
- 添加、删除、修改触发器,更新数据放入t_log表
- oracle 触发器临时数据
- Oracle 触发器 插入,更新,删除,数据同步,两表同步
- Oracle 触发器 插入,更新,删除,数据同步,两表同步
- Oracle 触发器 插入,更新,删除,数据同步,两表同步
- Oracle 触发器 插入,更新,删除,数据同步,两表同步
- Oracle 触发器 插入,更新,删除,数据同步,两表同步
- Oracle 触发器 插入,更新,删除,数据同步,两表同步
- Oracle 触发器更新本表数据
- oracle中从一个表中插入数据到另一个相同表结构的表中
- oracle临时表删除
- oracle 删除临时表
- oracle 删除临时表
- ORACLE使用触发器更新数据
- Oracle 触发器 插入|更新|删除,两表同步
- 迪杰斯特拉算法
- 使用 Adsutil.vbs 管理脚本
- JAVA获取文件的创建日期
- 命令行下IIS的配置脚本Adsutil.vbs
- 15、Linux2.6.31--网卡驱动移植(DM9000)
- oracle触发器添加更新删除数据到相同结构临时表
- 32位操作系统下跑sql server
- Linux内核2.6.14源码分析-双向循环链表代码分析(巨详细)
- 16、linux2.6.31--NAND FLASH驱动移植
- webService--返回数据集
- delphi判断windows系统是64位还是32位
- 17、Bootloader(1) ---Bootloader的结构
- 由 北大青鸟(骑士飞行棋)Demo 联想到了地图中的河流、路线绘制
- 在DirectX9.0中使用Mesh