db2look 导出函数 无法执行,谁帮忙看看
SET CURRENT SCHEMA = "F12SITST";SET CURRENT PATH = "SYSIBM","SYSFUN","SYSPROC","F12SITST";
CREATE FUNCTION F12SITST.F_LOT_TYPE (IN_LOT_ID VARCHAR(64) ) RETURNS CHARACTER(16)
LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA STATIC DISPATCH CALLED ON
NULL INPUT EXTERNAL ACTION INHERIT SPECIAL REGISTERS BEGIN ATOMIC return
with tmp(first,second,third) as ( select substr(IN_LOT_ID,locate('.',IN_LOT_ID)+1,1
), substr(IN_LOT_ID,locate('.',IN_LOT_ID)+2,1 ), substr(IN_LOT_ID,locate('.',IN_LOT_ID)+3,1
) from sysibm.sysdummy1 ) select (case when first='0' and second='0' and
third='0' then 'PARENT' when first>='A' and first<='Z' and second='0' and
third='0' then 'SPLIT' when second>='A' and second<='Z' and third>='1'
and third<='9' then 'AUTOSPLIT' when second>='0' and second<='9' and third>='A'
and third<='Z' then 'REWORK' else 'UNKNOWN' end) as lot_type from tmp;
END; 学习好资料啊。
页:
[1]