News
Abstract
Inlining support for User Defined Table Functions (UDTFs)
Content
CREATE FUNCTION (SQL table) - enhancement to support inlined UDTFs
Inline functions: When an SQL table function is inlined, instead of invoking the function as part of a query, the fullselect in the RETURN statement of the function may be copied (inlined) into the query itself. Such a function is called an inline function. A table function is an inline function if:
- The SQL function is defined as NO EXTERNAL ACTION.
- The SQL-routine-body contains only a RETURN statement.
- No column in the result table is the XML data type.
- All objects referenced in the function exist when the function is created.
- The SQL-routine-body does not contain a common table expression that references an input parameter.
An inline function is only copied (inlined) into a query if:
- The query is eligible for the SQL Query Engine (SQE).
- The function does not reference a table on a different server.
- The function references an object and the authority attributes of the function and the query are compatible based on one of the following conditions:
- The function is defined to run under the user's authority (*USER).
- The query is running under the owner's authority (*OWNER) and the owner of the query is the same as the owner of the function.
- The query is running under the user's authority (*USER), and the user or the user's group profile is the same as the owner of the function.
When a function is inlined, some of the options specified when the function was created are ignored:
- PARALLEL or NOT PARALLEL
- MODIFIES SQL DATA
- Commitment control level
- CONCURRENT ACCESS RESOLUTION
- ALWCPYDTA
- ATOMIC or NOT ATOMIC
If a function is inlined and it contains a reference to a special register, the value of the special register will be the same as other references to the same special register in the query.
Was this topic helpful?
Document Information
Modified date:
21 January 2020
UID
ibm11168192