日期:2014-05-17 浏览次数:20785 次
CREATE OR REPLACE TRIGGER mds_temperature_log_trg
AFTER INSERT
ON mds_temperature_log
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
declare
v_description varchar2(10);
v_areaid varchar2(10);
v_temperature number;
v_humidity number;
v_time date;
begin
if inserting then
v_areaid := :new.AREA_ID;
v_temperature :=:new.TEMPERATURE;
v_humidity := :new.HUMIDITY;
v_time := :new.CREATION_DATE;
select DESCRIPTION int v_description from mds_temperature_parameters where AREA_ID =v_areaid;
dbms_output.put_line(v_description);
-- if (v_description='IQC' and (v_temperature>26 or v_temperature<24)) or (v_description='IQC' and v_humidity<=70) then
-- insert into common_mail_notice values
-- (COMMON_MAIL_NOTICE_SEQ.nextval,5557,v_description||'|'|| v_TEMPERATURE||'|'||v_humidity||'|'||to_char(v_time,'yyyy-MM-dd HH24:mi:ss'),'N',sysdate,'SYS',sysdate,'SYS',sysdate);
-- end if;
end if;
end;
---int 改为into试试 select DESCRIPTION into v_description from mds_temperature_parameters where AREA_ID =v_areaid; --
------解决方案--------------------
select into 返回只能是单行。