刚刚接触存储过程,将相关知识点做如下总结1. 新建存储过程 create procedure testpro( col1 varchar(10) , col2 decimal(20)) returning decimal(10);define v_count varchar(10);select count(*) into v_count from systables;return v_count;end procedure;上例为一个简单的存储过程。在informix 中没有出参的写法,11.7版本之后才有了出参 ,调用的方法是需要新建一个存储过程传参。因为我的版本比较低,不能执行就不做具体解释了。2. 存储过程中的循环for i in (1 to 10 step 1)end for;foreachend foreach;个人用到的foreach比较多,写下foreach的用法foreachselecttabname into v_tabname from systables --该语句后不能有分号return v_tabname with resume;end foreach;foreach 语境:通常用于查询结果是多条的赋值3. informix 中的判断if ** then **elif ** then **else ***end if ;case when ... then ... else ** end语法同其他数据库一致,不做特殊说明注:以上仅代表个人观点,我自己总结的,如果有错误,欢迎大家批评指正,有不清楚的也可以找我,共同探讨,共同进步