Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: residntSure, the query itself if rather simple and does execute fine with the DB Query node. Basically what I'm doing is pulling in a directory of sql files and reading them in and passing them 1 by 1 into the DB execute node. The queries can be complex or rather simple like this one
SELECT DD.Event_Date
, DD.Metric_ID
, DD.Master_Ttl_Name
, CASE WHEN DD.Ttl_Name = D.Ttl_Name THEN 'Current Year'
WHEN DD.Ttl_Name = D.P1_Ttl_Name THEN 'Prior Year'
WHEN DD.Ttl_Name = D.P2_Ttl_Name THEN 'Prior 2 Year'
END AS Series_Name
, DM.Metric_Name
, DD.Data_Value
FROM DB.DASH DD
INNER JOIN DB.DASH_M DM
ON DD.Metric_ID = DM.Metric_ID
INNER JOIN DB.REF R
ON DD.Ttl_Name = R.Ttl_Name
INNER JOIN DB.USER D
ON R.Franchise_Code = D.Franchise_Code
WHERE 1=1
AND DD.Metric_ID IN(1,2)
AND D.Franchise_Code = 'XXX'
AND DD.Master_Ttl_Name = CASE WHEN Series_Name = 'Current Year' THEN D.Ttl_Name
WHEN Series_Name = 'Prior Year' THEN D.P1_Ttl_Name
WHEN Series_Name = 'Prior 2 Year' THEN D.P2_Ttl_Name END
AND DD.Platform_Code = 'Con'
The carriage return is being removed through a filter node as that was causing some issues. In the DB execute node the query is being call with this
sqlSelect (1, 'Query')
Which as mentioned all worked fine with the cli interface, but that interface was causing issues with the case in the query so instead of changing 42 queries decided to go with the ODBC driver which now is throwing the "WARN: Bind name in sql statement is empty. Col: 52" error
Thanks
Jason