我在存储过程中使用下面的代码。只要我不使用TEMP_3的块,它就工作正常。我得到了这样的错误
在游标值构造函数的例程、复合SQL语句或参数列表中不支持参数或SQL变量“'WITH TEMP AS(SELECT * FROM TABLEE”的数据类型。SQLCODE= -789,SQLSTATE= 429 BB,DRIVER=4.28.11
DECLARE C1 CURSOR FOR S1;
'WITH TEMP AS (
SELECT *
FROM TABLEE
WHERE ID = 2
)),
TEMP_1 AS (
SELECT COUNT(1) AS ID FROM NEW TABLE (
INSERT INTO TABLE_A (Col_1, Col_2)
SELECT Col_1, 'A'
FROM TABLE_A
JOIN TABLEE ON ID = Col_1
)),
TEMP_2 AS (
SELECT COUNT(1) AS ID FROM NEW TABLE (
INSERT INTO TABLE_B (Col_1, Col_2)
SELECT Col_1, 'B'
FROM TABLE_B
JOIN TABLEE ON ID = Col_1
)),
TEMP_3 AS (
SELECT COUNT(1) AS ID FROM NEW TABLE (
INSERT INTO TABLE_C (Col_1, Col_2)
SELECT Col_1, 'C'
FROM TABLE_C
JOIN TABLEE ON ID = Col_1
)),
SELECT 1
FROM SYSIBM.SYSDUMMY1';
OPEN C1;
CLOSE C1;
1条答案
按热度按时间ltskdhd11#
错误太多。
仅举一个目标表示例。
请提供完整的示例以及相应的
CREATE TABLE
和INSERT INTO
声明以及this示例。