我正在使用 DB2 z/OS 11.1.5。根据这个参考first_value
,至少在 DB2 9.7 中应该支持OLAP 函数,例如。但是,当尝试执行查询时
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;
我得到了错误
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.
. 我知道错误代码列表。但是,这些描述并不能帮助我理解问题。