Declare temp table inside UserDefined Function in DB2 AS400

天涯浪子 提交于 2019-12-12 03:45:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!