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
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]
Was this topic helpful?
Document Information
Modified date:
14 January 2020
UID
ibm11167700