作者:dmcm0001 | 来源:互联网 | 2023-05-18 07:17
I have written a DB2 query to do the following:
我编写了一个DB2查询来执行以下操作:
- Create a temp table
创建临时表
- Select from a monster query / insert into the temp table
从怪物查询中选择/插入到临时表中
- Select from the temp table / delete from old table
从临时表中选择/从旧表中删除
- Select from the temp table / insert into a different table
从临时表中选择/插入到不同的表中
In MSSQL, I am allowed to run the commands one after another as one long query. Failing that, I can delimit them with 'GO' commands. When I attempt this in DB2, I get the error:
在MSSQL中,我被允许一个接一个地运行命令作为一个长查询。如果做不到这一点,我可以用'GO'命令来划分它们。当我在DB2中尝试这个时,我收到错误:
DB2CLI.DLL: ERROR [42601] [IBM][CLI Driver][DB2] SQL0199N The use of the reserved
word "GO" following "" is not valid. Expected tokens may include: "".
SQLSTATE=42601
What can I use to delimit these instructions without the temp table going out of scope?
如果没有临时表超出范围,我可以使用什么来界定这些指令?
3 个解决方案