Is there a way to pass a list of values in a variable and use that in an IN() statement to check a field against the passed in list of values?
The only thing I can think
TD14 supports a nice table function called STRTOK_SPLIT_TO_TABLE:
REPLACE MACRO testmac(param VARCHAR(1000)) AS
(
SELECT * FROM dbc.DatabasesV AS db
JOIN
(
SELECT token AS DatabaseName, tokennum
FROM TABLE (STRTOK_SPLIT_TO_TABLE(1, :param, ',')
RETURNS (outkey INTEGER, -- usually the PK of the table, here it's just a dummy
tokennum INTEGER, -- order of the token within the param string
token VARCHAR(128) CHARACTER SET UNICODE)
) AS d
) AS dt
ON db.DatabaseName = dt.DatabaseName
ORDER BY tokennum;
);
EXEC testmac('dbc,systemfe,syslib');