I'm sorry, I forgot. Here's a little workaround ;)
you have to first add a query, e.g. "SELECT NULL as datedata", next configure column mapping and save configuration.
Then you can replace the query and it works (you just have to cancel the warning)
I did all that, received the same info, saved and failed :(
Could you provide also screenshots from configuration, and Webcon version?
(webcon doesn't have great support for all parts of SQL and CTE's are one of them - that's why I'm using functions, to avoid webcon trying to parse CTE).
yes - function may be a better solution but sometimes it is not possible to modify/add anything to the database :/
Hello there :)
I have the following error, attached.
Best Regards
I'm sorry, I forgot. Here's a little workaround ;)
you have to first add a query, e.g. "SELECT NULL as datedata", next configure column mapping and save configuration.
Then you can replace the query and it works (you just have to cancel the warning)
Hello there :)
I have the following error, attached.
Best Regards
Could you provide also screenshots from configuration, and Webcon version?
(webcon doesn't have great support for all parts of SQL and CTE's are one of them - that's why I'm using functions, to avoid webcon trying to parse CTE).
I have something like this and it works :-)
Hello there :)
I have the following error, attached.
Best Regards
I have something like this and it works :-)
Hello there!
I have the following error :(
I have something like this and it works :-)
Oh, so it seems like inside initialization CTE are working just fine - inside business rules CTE's are a trouble, so I'm using functions as a workaround. Good to know!
It's basically the same solution, just without wrapping it inside a function :)
I have something like this and it works :-)
Hi
I'd go with creating a function for that task, and would use recursive CTE.
Function like this:
CREATE FUNCTION dbo.generate_date_range(@start_date DATE, @end_date DATE)
RETURNS @DateRange TABLE (DateValue DATE)
AS
BEGIN
WITH DateRange AS (
SELECT CAST(@start_date AS DATE) AS DateValue
UNION ALL
SELECT DATEADD(day, 1, DateValue)
FROM DateRange
WHERE DateValue < @end_date
)
INSERT INTO @DateRange(DateValue)
SELECT DateValue
FROM DateRange OPTION (MAXRECURSION 1000) -- Option could be set to 0, but I'd rather avoid unintentional infinity loop :)
RETURN;
END
Later inside webcon use it like that:
select * from generate_date_range('2024-01-01', '2024-01-10')