Using Form/Workbench 2022.2, connecting to MSSQL 15 with 10.9 SDE over the top.
I'm not an SQL expert, and this statement was a combination of my knowledge, ChatGPT and colleagues knowledge
SELECT
p.*,
-- Calculate the rate of nitrogen (N) application over the entire spread.
-- Convert the area to hectares, then multiply by the rate to get the total weight.
-- Finally, divide by the applied area to obtain the average rate.
SUM(p.Shape.STArea() / 10000 * p.NutrientN / p.AppliedAreaInHa) OVER () AS total_n_rate,
-- Calculate the total fertilizer rate over the entire spread.
-- Convert the area to hectares, then multiply by the rate to get the total weight.
-- Finally, divide by the applied area to obtain the average rate.
SUM(p.Shape.STArea() / 10000 * p.RateKgPerHa / p.AppliedAreaInHa) OVER () AS total_fert_rate
FROM
[Agtech].[MASTER].[ProofOfPlacementSwath_evw] p
WHERE
p.[SwathMergeID] = '@Value(swathmerge)';
This runs fine in SSMS with no errors and returns expect results.
When I put this into an SQL Executor in FME it runs and I get the expected results, but it gives me a warning:
I'm happy that the query is working, but it fills up the logs with 1000s of lines of warnings which suppresses other warnings in the logs.
The code snippet i've included obviously has comments. I've found advice to remove comments but I get the same result regardless of comments being there or not.
Any idea whats not quite right with this?