MS SQL 2016 Content Server 16.2.11
Attempting to create a temp table that a WebReport will then query. I know in versions back there used to be a checkbox that had to be checked in the LiveReport to allow writes to the database. Now it seems you need to create a new specific connection which I've done. Its a user that has read only rights to all the existing tables but has the ability to create temp tables.
I have verified the query as this new user via TOAD and it creates and drops the table as desired. But when I attempt to run it in Content Server I get the error: Error Processing Request. Refer to CS Logs.
The logs show
ERROR [2577538220532] 0000319367: ODBC error (LOCAL) : Wrong number of arguments specified in bind. (0.vs.1)
ERROR [2577538220566] 0000319368: KSqlCursor::Bind(0,{}) --> 'Could not bind.'
Here is the SQL: Anyone have an idea what I'm doing wrong ?
IF OBJECT_ID(N'tempdb..#tempRegulatoryAttributes') IS NOT NULL
BEGIN
DROP TABLE #tempRegulatoryAttributes
END
GO
-- *Create Attributes Temp Table*
-- :
SELECT *
INTO #tempRegulatoryAttributes
FROM (
SELECT parentId
, dataId
, name
, CASE
WHEN name LIKE '%completion%' THEN 'comp'
WHEN name LIKE '%Sundry%' THEN 'sun'
WHEN name LIKE '%P&A%' THEN 'PA'
WHEN name LIKE '%APD%' THEN 'APD'
END AS catValue
FROM [OTCSPROD].DTree
WHERE parentId = 25885819
) AS a;