Oracle触发器 在线等待

[复制链接]
查看11 | 回复2 | 2010-6-12 23:14:28 | 显示全部楼层 |阅读模式
Oracle 11g如何创建触发器实现:将A表中的数据删除时,把删除的数据保存到B表中。

回复

使用道具 举报

千问 | 2010-6-12 23:14:28 | 显示全部楼层
Create Or Replace Trigger TR_AAfter Delete On AFor Each RowBeginInsert Into B (Id,Name,age) Values (:Old.Id,:Old.Name,:Old.age);End;--用三列做个例子,具体代码需要看你的表
回复

使用道具 举报

千问 | 2010-6-12 23:14:28 | 显示全部楼层
Create Or Replace Trigger TR_Abefore Delete On AFor Each RowBeginInsert Into B select id,name from A;End;你要这样用需要考虑效率问题。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行