How i can put a result set from a stored procedure in a temporary table in DB2

此生再无相见时 提交于 2019-12-11 07:02:11

问题


The title is very descriptive i think... My scenario is the next. I need to put the result of a result set (for example a result set with 6 columns and variable rows) from a stored procedure in some temporary table to make some operations over this new table. I find some examples in the web but nothing in DB2... The big problem is how to populate that new table with the restult set of a called stored procedure


回答1:


DECLARE GLOBAL TEMPORARY TABLE probably accomplishes what you want. You can create this type of temporary table inside a stored procedure. It is visible only to the current session and is cleaned up for you when the session ends.



来源:https://stackoverflow.com/questions/5185578/how-i-can-put-a-result-set-from-a-stored-procedure-in-a-temporary-table-in-db2

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