当前位置: 代码迷 >> Oracle开发 >> 一个简单的触发器,可是它在报错。该怎么解决
  详细解决方案

一个简单的触发器,可是它在报错。该怎么解决

热度:56   发布时间:2016-04-24 07:31:30.0
一个简单的触发器,可是它在报错。。。
SQL code
CREATE OR REPLACE TRIGGER mds_temperature_log_trgAFTER INSERTON mds_temperature_logREFERENCING NEW AS NEW OLD AS OLDFOR EACH ROWdeclarev_description varchar2(10);v_areaid varchar2(10);v_temperature  number;v_humidity number;v_time date;beginif 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;

===================================================================================
(1):PL/SQL: ORA-00923: 未找到要求的 FROM 关键字
(2):PL/SQL: SQL Statement ignored

------解决方案--------------------
SQL code
---int 改为into试试select DESCRIPTION into v_description from mds_temperature_parameters where AREA_ID =v_areaid;--
------解决方案--------------------
select into 返回只能是单行。
  相关解决方案