帮忙写这个触发器

flyfish2k 2004-08-11 05:12:00
想给一个表写个触发器,功能就是在修改一条记录时把系统当前时间填写到这个表的lastmodify字段中。不知道如何弄!是oracle数据库。
...全文
121 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wylwyl1130 2004-08-12
  • 打赏
  • 举报
回复
very good!!!
dinya2003 2004-08-12
  • 打赏
  • 举报
回复
通过,
zhpsam109 2004-08-11
  • 打赏
  • 举报
回复
楼上的写法真好!
beckhambobo 2004-08-11
  • 打赏
  • 举报
回复
create trigger a_tri
before update on a
for each row
begin
:new.lastmodify:=sysdate;
end;
/
armyyd 2004-08-11
  • 打赏
  • 举报
回复
create or replace trigger tri_insertUserMT
before insert or update on t_user
for each row
declare
-- local variables here
begin
select sysdate into :new.lastmodify from dual;
end tri_updateMT;

正解!
mickey_uuu 2004-08-11
  • 打赏
  • 举报
回复
create or replace trigger tri_insertUserMT
before insert or update on t_user
for each row
declare
-- local variables here
begin
select sysdate into :new.lastmodify from dual;
end tri_updateMT;
wylwyl1130 2004-08-11
  • 打赏
  • 举报
回复
变异表的问题

17,078

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧