基于sysdate的触发器 [英] Trigger based on sysdate

查看:106
本文介绍了基于sysdate的触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格

表格架构:

CREATE TABLE CHARGES 
(
    total NUMBER(30),
    admitdate TIMESTAMP(6),
    dischargedate TIMESTAMP(30)
)

触发器算法:

if 
{
   dischargedate="null" 
   then total=admitdate-sysdate=difference in days * Total
   Do this every day at 12:00(24 Hr. Format)
}
else
{
    Do Nothing;
}

我的问题是如果系统在上午12:00离线。这个问题不允许触发器运行。

My question is what to do if the system is offline at 12:00 am. This problem will not allow the trigger to run.

推荐答案

要在特定时间运行一段代码, em>作业。触发器只有响应表更改。
如果服务器关闭(几乎不可能),则作业可以稍后运行。

To run a piece of code on a specific time, you can use jobs. Triggers are there only to respond to table changes. If the server is down (which it should hardly ever be), the job can be run at a later time.

这篇关于基于sysdate的触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆