I have a Thingworx Service (SQL Query) in my Database Thing, eg. GetCookiesByIds
I have a parameter ids (STRING) with value 1,2,3
I would like to make a query:
SELECT * FROM Cookies WHERE id IN ([[ids]])`
But I have an exception.
How to cast my parameter ids into the valid format?
A simple an portable option is:
... where
$1represents the CSV string that is the parameter to your query.In Postgres, we can also use arrays: