问题
How to create user defined function with declare temporary table in AS400?
I can't create a temporary table under parent procedure, because i'm using Parallel Jobs. So i need to create temporary table inside function only helps me.
Did anybody knows the solution, kindly update here friends.
回答1:
example of temporary table :
DECLARE GLOBAL TEMPORARY TABLE nametemporarychoice AS (
YOURQUERYHERE
) WITH DATA WITH REPLACE NOT LOGGED;
you can use your table like this:
select * from qtemp.nametemporarychoice
or like this:
select * from session.nametemporarychoice
来源:https://stackoverflow.com/questions/39570859/declare-temp-table-inside-userdefined-function-in-db2-as400