Can I still use “SET” in my SQL statements in the new DB Query Reader?
I generated all my (many!) SQL statements using scripts that ended up looking something like this:
SET @NodeName = 'Input Product Array';
SET @NodeScenario = 'Actual';
SET @FocusClient = $${SFocusClient}$$;
SET @FocusReportDate = $${SFocusReportDate}$$;
SELECT
ReportDate AS ReportDate,
FocusProduct,
Description AS Description,
Price AS Price,
Cost AS Cost,
Quantity AS Quantity,
Share AS Share,
Revenue AS Revenue,
Profit AS Profit
FROM simProductArray
WHERE FocusClient=@FocusClient
AND DATE_FORMAT(ReportDate, '%Y-%m-%d;%H:%i:%s.%f')=@FocusReportDate
AND NodeName=@NodeName
AND NodeScenario=@NodeScenario
AND Product = FocusProduct
ORDER BY Revenue DESC
I can’t remember why, but the use of the “SET” statements was critical in my script. Unfortunately the new DB Query Readers hate “SET” (I think because the nodes wrap an additional SELECT around the SQL statement). Looks like I am going to have to manually change them all anyway, but is there a way to keep the “SET” (or an equivalent) such that all my WHERE variables remain at the top of the SQL statement?