zoukankan      html  css  js  c++  java
  • TRIGGERS_监测系统_原始数据表触发器—调用告警信息存储过程

    //每次向originaldata表中插入数据就会触发该触发器

    create or replace trigger originaldata_to_alarm
      after insert on originaldata
      for each row

    declare
      v_temperature   num_array := num_array(1, 0);
      v_humidity      num_array := num_array(1, 0);
      v_concentration num_array := num_array(1, 0);
    begin
       v_temperature.extend(10);
      v_humidity.extend(10);
      v_concentration.extend(3);
      v_temperature(1) := :new.temperature1;
      v_temperature(2) := :new.temperature2;
      v_temperature(3) := :new.temperature3;
      v_temperature(4) := :new.temperature4;
      v_temperature(5) := :new.temperature5;
      v_temperature(6) := :new.temperature6;
      v_temperature(7) := :new.temperature7;
      v_temperature(8) := :new.temperature8;
      v_temperature(9) := :new.temperature9;
      v_temperature(10) := :new.temperature10;
      v_humidity(1) := :new.humidity1;
      v_humidity(2) := :new.humidity2;
      v_humidity(3) := :new.humidity3;
      v_humidity(4) := :new.humidity4;
      v_humidity(5) := :new.humidity5;
      v_humidity(6) := :new.humidity6;
      v_humidity(7) := :new.humidity7;
      v_humidity(8) := :new.humidity8;
      v_humidity(9) := :new.humidity9;
      v_humidity(10) := :new.humidity10;
      v_concentration(1) := :new.concentration1;
      v_concentration(2) := :new.concentration2;
      v_concentration(3) := :new.concentration3;
      --调用存储过程
      proc_alarmlog(:new.id,:new.ipcode,:new.time,v_temperature,v_humidity,v_concentration);
    end originaldata_to_alarm;

  • 相关阅读:
    nginx模块学习——nginx_http_push_module模块深入讲解和聊天室实现
    常见的qq在线客服代码
    MongoDB数据库介绍及安装(一)
    Python 创建类
    Python backup脚本
    Python 类的初始化小案例
    Python 类实例化
    Python 类初始化__init__
    ObjC(ObjectiveC): NSString应该用initWithFormat? 还是 stringWithFormat?
    NSUserDefaults
  • 原文地址:https://www.cnblogs.com/hy928302776/p/3233205.html
Copyright © 2011-2022 走看看