It is strange that this SQL works fine in SQL-Assistant, but when called througha procedure throws error. I have checked with recursive CTE as well, but it throws the same error.
But it works fine the usual derived table syntax, as follows
REPLACE MACRO with_test_proc AS
(
INSERT
INTO
with_target
(
b
)
SELECT b
FROM
(
SELECT
1 b
FROM
with_source
) tmp
UNION
SELECT
b + 1
FROM
(
SELECT
1 b
FROM
with_source
) tmp
;
);
Can it help you scenario?
It is strange that this SQL works fine in SQL-Assistant, but when called througha procedure throws error. I have checked with recursive CTE as well, but it throws the same error.
But it works fine the usual derived table syntax, as follows
Can it help you scenario?