我正在使用DB2 LUW,并希望将With子句的结果赋给存储过程中的变量。
我得到了例外
{0:0} An unexpected token "AS" was found following "l = (WITH BASE". Expected tokens may include: "JOIN".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.28.11
是否可以用这种方式指定结果,或者我必须用光标来求解它?
DECLARE result CLOB(8M);
SET result = (WITH BASE AS (
xxx
)
SELECT JSON_ARRAY (select json_objects FROM ITEMS format json) FROM SYSIBM.SYSDUMMY1);
1条答案
按热度按时间jei2mxaa1#
请改用以下语法样式:
with ctename AS ( ... ) SELECT ... INTO ... FROM ctename;