I am using DB2 z/OS 11.1.5. According to this reference, OLAP functions such as
first_value should be supported at least in DB2 9.7. However, when trying to execute the query
declare global temporary table T (reference integer, val integer) on commit preserve rows; insert into session.T values(1, 10); insert into session.T values(2, 20); select first_value(val) over (order by reference) from session.T;
I am given the error
NO AUTHORIZED FIRST_VALUE NAMED HAVING COMPATIBLE ARGUMENTS WAS FOUND. SQLCODE=-440, SQLSTATE=42884, DRIVER=4.18.60. 2) [Error Code: -514, SQL State: 26501] THE CURSOR SQL_CURLH200C1 IS NOT IN A PREPARED STATE.. I am aware of the listing of error codes. However, these descriptions do not help me to understand the problem.