比如表
create table test(
id char(10),
name char(50),
biaoshi char(2))写一个触发器,要实现如下功能:
当对此表执行insert 命令时 ,在biaoshi字符段里做‘a’标识
当对此表执行update 命令时 ,在biaoshi字符段里做‘b’标识
当对此表执行delete 命令时 ,在biaoshi字符段里做‘c’标识在oracle下的触发器。谢谢各位
create table test(
id char(10),
name char(50),
biaoshi char(2))写一个触发器,要实现如下功能:
当对此表执行insert 命令时 ,在biaoshi字符段里做‘a’标识
当对此表执行update 命令时 ,在biaoshi字符段里做‘b’标识
当对此表执行delete 命令时 ,在biaoshi字符段里做‘c’标识在oracle下的触发器。谢谢各位
解决方案 »
- oracle 存储过程 传出参数是cursor 没有open 异常处理
- 【求助】请高手们给指点一下,DELETE删除的数据如何恢复原样?
- 启动OEM,如何“登录到Oracle Management Server"?
- 如何在命令行调用oracle编译工具编译PL/SQL过程? 有谁开发过PL/SQL编辑器,或者提供点思路。
- oracle的sequence问题
- 如何在储发器中调用存储过程???
- ??!!计算日期是一年的第几周的SQL语句!!??
- 谁帮我把这个SQL Server下的查询转成Oracle版的?
- 求职
- 急急急 谢谢大神们帮助
- oracle 视图名以v$开头是表示系统的视图名还是什么约定?
- 求助一个与时间有关的SQL语句
on test
for each row
begin
if inserting then :new.biaoshi := 'a’; elsif updating then :new.biaosh := 'b'; elsif deleting then :new.biaoshi := 'c'; else
:new.biaoshi :='d'end;
删除那一行就没有了
before insert or update or delete on test
for each row
begin
if inserting then
:new.biaoshi:='a';
elsif updating then
:new.biaoshi:='b';
elsif deleting then
:new.biaoshi:='c';
end if;
end;
删除的时候修改biaoshi也没什么用阿,修改后数据又被删了
动作好快,高手
这个在test表对应的触发器上加吗?老是提示我没有new 或者clob类型啊。请指教。谢谢各位
on test
for each row
begin
if inserting then :new.biaoshi := 'a’; elsif updating then :new.biaosh := 'b'; else
:new.biaoshi :='c';
end if;end;
FOR DELETE AS
IF EXISTS (SELECT * FROM deleted WHERE deliverflag != c)
BEGIN
DECLARE @a int
select @a = id from deleted
ROLLBACK
update test set biaoshi= 3 where id = @a
END