Table Valued User Defined Functions in DB2 Z/OS

826 Views Asked by At

Does anyone know if DB2 v9.1 z/OS supports Table Valued User Defined Functions?

This is what I am trying to create but I keep getting the error message below.

CREATE FUNCTION func_test(v_vchCol CHAR(10))
RETURNS TABLE(col_a char(10), row_cnt integer)
LANGUAGE SQL
SPECIFIC FUNCINFO
NOT DETERMINISTIC
READS SQL DATA
return 
  select col_1, count(*)
    from SCHEMA_NAME.TEST1
   where col_1 = v_vchCol 
   group by col_1;

Error Message:

ERROR [56038] [IBM][DB2] SQL0969N There is no message text corresponding to SQL error "-4700" in the message file on this workstation. The error was returned from module "DSNHSMS1" with original tokens "". SQLSTATE=56038

Any help would be much appreciated

1

There are 1 best solutions below

2
On

Yes, but it appears to require new function mode which apparently isn't enabled yet in the DB2 instance you're connected to.