I'm a T-SQL guy and I'm trying to write a function that returns a table in DB2 (on our iSeries V5R4).
I can create the function but I can't select from it. Attached is the DDL I am using. This is a very simple example using IBM supplied objects just to show my point.
I just don't understand why I can't select from the function. When I try I get the following error.
SQL State: 42704
Vendor Code: -204
Message: [SQL0204] TESTFUNC in *LIBL type *N not found. Cause . . . . . : TESTFUNC in *LIBL type *N was not found. If the member name is *ALL, the table is not partitioned. If this is an ALTER TABLE statement and the type is *N, a constraint or partition was not found. If this is not an ALTER TABLE statement and the type is *N, a function, procedure, trigger or sequence object was not found. If a function was not found, TESTFUNC is the service program that contains the function. The function will not be found unless the external name and usage name match exactly. Examine the job log for a message that gives more details on which function name is being searched for and the name that did not match. Recovery . . . : Change the name and try the request again. If the object is a node group, ensure that the DB2 Multisystem product is installed on your system and create a nodegroup with the CRTNODGRP CL command. If an external function was not found, be sure that the case of the EXTERNAL NAME on the CREATE FUNCTION statement exactly matches the case of the name exported by the service program.
Start Free Trial