db2look 导出的函数 function 无法执行,谁能看看是怎么回事

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 ONNULL IN...显示全部
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;收起
参与8

查看其它 6 个回答drdb2的回答

drdb2drdb2系统工程师se
你一定是把“--”编辑掉了。
CREATE FUNCTION F12SITST.F_LOT_TYPE (IN_LOT_ID VARCHAR(64) ) RETURNS CHARACTER(1
6)
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;
DB20000I  The SQL command completed successfully.
互联网服务 · 2011-11-27
浏览1093

回答者

drdb2
系统工程师se

drdb2 最近回答过的问题

回答状态

  • 发布时间:2011-11-27
  • 关注会员:1 人
  • 回答浏览:1093
  • X社区推广