在DB2 AS400中的UserDefined Function中声明临时表 [英] Declare temp table inside UserDefined Function in DB2 AS400

查看:175
本文介绍了在DB2 AS400中的UserDefined Function中声明临时表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在AS400中使用声明临时表来创建用户定义的函数?

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.

推荐答案

临时表示例:

      DECLARE GLOBAL TEMPORARY TABLE nametemporarychoice AS ( 
      YOURQUERYHERE
      ) WITH DATA WITH REPLACE NOT LOGGED;

您可以像这样使用表格:

you can use your table like this:

     select * from qtemp.nametemporarychoice 

或类似这样:

     select * from session.nametemporarychoice 

这篇关于在DB2 AS400中的UserDefined Function中声明临时表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆