SQL: passing part of query as input parameter
I have simple SQL query:
SELECT [column 1], [column 2], [column3] ...
FROM [table] WHERE [column1]= 31.
In my case, conditions are chaning, sometimes I have no WHERE part of querry, sometimes I have 1 column, sometimes 3, depending on operators behaviour.
So in query, I added variable filter as parameter, and make a querry like:
SELECT [column 1], [column 2], [column3] ...
FROM [table] [[filter]]
and filter would generated by external service and can be empty if all data needed, but can be also WHERE [column1]=31, or any other combination of WHERE.
Unfortunatelly, no matter if I keep filter value empty, or I do put there my WHERE conditions, I receive
"Unable to Invoke Service ... on ... : Execute Query failed. Please check Database logs for more details."
Have tried to call this service manually, have tried to call by other service, changed name of variable to be sure it's not forbidden word... no changes.
Have tried with filter as both, String and Text type.
Any body has idea how to cope with this issue, without generating extra querries for every possible case?
TWX version: ThingWorx 9.5.1-b359


