简体   繁体   English

为什么我的 function 不能在 DB2 LUW 上使用相同的关键字?

[英]Why can my function not use same keywords on DB2 LUW?

I have following function on IBM i DB2 and want to use it on DB2 LUW (Linux).我在 IBM i DB2 上关注 function 并想在 DB2 LUW (Linux) 上使用它。 The error I receive is "Multiple or conflicting keywords involving the "FENCED" clause are present.. SQLCODE=-628, SQLSTATE=42613".我收到的错误是“存在涉及“FENCED”子句的多个或冲突的关键字。SQLCODE=-628,SQLSTATE=42613”。 Why can I not use it?为什么我不能使用它? The documentation lists the keywords, so I do not understand...文档列出了关键字,所以我不明白......

CREATE OR REPLACE FUNCTION getHex2Char(IN_HEXCHAR VARCHAR(8))
RETURNS INT
DETERMINISTIC
RETURNS NULL ON NULL INPUT
NO EXTERNAL ACTION 
BEGIN
-- Do some SQL stuff and return result
END

The currently supported Db2-LUW versions allow the clause called on null input ( the syntax null call has the same meaning ) with the create function statement.当前支持的 Db2-LUW 版本允许called on null input子句(语法null call具有相同的含义)与create function语句。

But the function can return a NULL or a NOT NULL value, when the input is null.但是,当输入为 Z37A6259CC0C8DAE0264 时,function 可以返回 NULL 或 NOT NULL 值

The Db2 for i implementation of returns null on null input is not currently in the Db2-LUW implementation. Db2 用于returns null on null input当前不在 Db2-LUW 实现中。

Reference Db2-LUW documentation link .参考 Db2-LUW 文档链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM