|
|
|
|
|
by typ
506 days ago
|
|
Here is a contrived example: CREATE MACRO foo(bar, baz) AS TABLE
WITH
base AS (
FROM query_table(bar) t
),
refined AS (
FROM base
JOIN query_table(baz) u ON base.id = u.id
)
SELECT * FROM refined;
I want to test many user-defined combinations of (bar, baz). How can I pass a macro instance to query_table like FROM (
(FROM foo(mybar1(some_arg1, some_arg2), mybaz101(500)))
UNION ALL
(FROM foo(mybar2(some_arg3, some_arg4), mybaz201(300)))
UNION ALL
...
)
SELECT *;
Your second example using the 'query_macro' looks like something I was looking for. But it doesn't seem to be of general use that supports an arbitrary number of arguments. |
|