Fixes are available
DB2 Version 11.1 Mod1 Fix Pack1 iFix001 for Linux, UNIX, and Windows
DB2 Version 11.1 Mod 2 Fix Pack 2 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod2 Fix Pack2 iFix001 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod2 Fix Pack2 iFix002 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod 3 Fix Pack 3 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod3 Fix Pack3 iFix001 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod3 Fix Pack3 iFix002 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod4 Fix Pack4 iFix001 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod 4 Fix Pack 4 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod 4 Fix Pack 6 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod 4 Fix Pack 5 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod 4 Fix Pack 7 for Linux, UNIX, and Windows
APAR status
Closed as fixed if next.
Error description
When a UDF is invoked with a default parameter (either implicitly or explicitly), and the UDF is itself an argument to an aggregate function, and the query is within SQL PL or PL/SQL, SQLCODE -120 may be returned, e.g.: CREATE OR REPLACE FUNCTION fdef( IN p_int integer default 9909 ) RETURNS integer LANGUAGE SQL NO EXTERNAL ACTION DETERMINISTIC BEGIN RETURN p_int; -- END DB20000I The SQL command completed successfully. create or replace function f() returns int language sql BEGIN DECLARE l_rtn CURSOR; -- DECLARE result int; --- SET l_rtn = CURSOR FOR SELECT max(FDEF(DEFAULT)) FROM T group by col1; -- OPEN l_rtn; -- fetch l_rtn into result; -- CLOSE l_rtn; -- return result; -- END SQL0120N Invalid use of an aggregate function or OLAP function.
Local fix
Do not make use of the DEFAULT value, add an explicit argument.
Problem summary
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 version 11.5.5 * ****************************************************************
Problem conclusion
Temporary fix
Comments
APAR Information
APAR number
IT16575
Reported component name
DB2 FOR LUW
Reported component ID
DB2FORLUW
Reported release
B10
Status
CLOSED FIN
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2016-08-11
Closed date
2021-02-18
Last modified date
2021-02-18
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Applicable component levels
RB10 PSN
UP
Document Information
Modified date:
04 May 2022