News
Abstract
Allow LANGUAGE SQL functions to reference files in an IASP and files in SYSBAS
Content
You are in: IBM i Technology Updates > Db2 for i - Technology Updates > Db2 for i Functional Enhancements > Allow LANGUAGE SQL functions to reference files in an IASP and files in SYSBAS
SQL functions residing in an IASP can reference tables and views within the IASP and *SYSBAS.
Creating a LANGUAGE SQL function in an IASP that references objects within *SYSBAS used to fail with SQL7008.
QTEMP is considered to belong to *SYSBAS, not the IASP in use by the job.
Example of usage that is now allowed:
CREATE TABLE QTEMP.WORK_TABLE AS (SELECT IBMREQD FROM SYSIBM.SYSDUMMY1) WITH DATA
CREATE FUNCTION IASPLIB.COUNTIT()
RETURNS BIGINT
LANGUAGE SQL FENCED
P1: BEGIN
DECLARE WORK_VARIABLE BIGINT;
SELECT COUNT(*) INTO WORK_VARIABLE FROM QTEMP.WORK_TABLE;
RETURN(WORK_VARIABLE);
END P1
set path = IASPLIB
select COUNTIT() from sysibm.sysdummy1
Result of query: 1
[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"ARM Category":[{"code":"a8m0z0000001iIWAAY","label":"IBM i Db2-\u003EUDF - user-defined function"}],"Version":"All Versions"}]
Was this topic helpful?
Document Information
Modified date:
31 October 2026
UID
ibm11167700