CREATE FUNCTION fx_getcatp(fx_catp varchar(4)) RETURNS varchar(128)
LANGUAGE SQL
BEGIN ATOMIC
DECLARE fx_value varchar(128) ;--
set (fx_value) =(select fx_value from fx_catp where fx_key = fx_catp);--
return fx_value;--
end
;
这个db2 函数 报错,错误代码如下:
16:00:24 [CREATE - 0 row(s), 0.000 secs] [Error Code: -104, SQL State: 42601] DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=);fx_value varchar(128;END-OF-STATEMENT, DRIVER=3.50.152
16:00:24 [SET - 0 row(s), 0.000 secs] [Error Code: -104, SQL State: 42601] DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=set;BEGIN-OF-STATEMENT;SELECT, DRIVER=3.50.152
16:00:24 [RETURN - 0 row(s), 0.000 secs] [Error Code: -104, SQL State: 42601] DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=END-OF-STATEMENT;return fx_value;JOIN <joined_table>, DRIVER=3.50.152
16:00:24 [END - 0 row(s), 0.000 secs] [Error Code: -104, SQL State: 42601] DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=END-OF-STATEMENT;end;JOIN <joined_table>, DRIVER=3.50.152
... 4 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 4 errors]
请大神回帖!!!!!!非常感谢。
------解决方案--------------------
-104 42601 SQL语句中遇到非法符号
将end最后的分号去掉试一下。还有4、5、6行的--也去掉。
------解决方案--------------------
db2 ? 楼主应该去其他数据库发帖。。。发错地方了。。