informinx 里面可以有自定义函数吗? 类似mssql,oracle,db2里的create function f_test..这样的语句?
有的话,请提供具体的例子。
------解决方案--------------------------------------------------------
有的,语法和Oracle基本类似 create funtion
CREATE FUNCTION update_by_pct ( pct INT, pid CHAR(10)) RETURNING INT; DEFINE n INT; UPDATE inventory SET price = price + price * (pct/100) WHERE part_id = pid;
CREATE FUNCTION
2-110 IBM Informix Guide to SQL: Syntax
LET n = price; RETURN price; END FUNCTION DOCUMENT "USAGE: Update a price by a percentage", "Enter an integer percentage from 1 - 100", "and a part id number" WITH LISTING IN ’/tmp/warn_file’