首页 > 解决方案 > 在 informix 12.10 中执行过程时出现语法错误

问题描述

我正在尝试在 Informix 12.10 中创建一个具有 2 个输入参数的过程。我想在表格中插入时间过滤结果。但是当我执行这段代码时,我得到了一个语法错误。

create dba procedure informix.damper_count (from_date nvarchar(25),to_date nvarchar(25))
 
   begin 
    delete damper_count_temp
    insert into  damper_count_temp (station,device,event,count)
    select * 
    from (select 'SWA' ,'TVD 01' ,'Damper Close' ,count(cmrl_desccol ) from "informix".alarms
        where desccol LIKE '%%SWA_TVD_1 - Damper Close%' and LocalCol between from_date and to_date
        union
        select 'SWA' ,'TVD 01' ,'Damper Open' ,count(cmrl_desccol ) from "informix".alarms 
        where desccol LIKE '%%SWA_TVD_1 - Damper Open%' and LocalCol between from_date and to_date   )                                                                                                                                                                                                     
   end
end procedure;

请帮我解决这个问题。

标签: procedureinformix

解决方案


添加一个; 在过程中的删除、插入和选择语句的末尾。不确定你需要一个开始/结束


推荐阅读