Hovik sent me a Powerpoint document that goes into detail on how to prevent this.
The example in the doc uses an assisted SQL resource but I am using a native SQL resource.
"Use Prepared Statements" is checked for my DB resource.
The query is defined as
SELECT * FROM MyTable &&WHERECLAUSE
The resource field WHERECLAUSE has unique key, read only and persistent unchecked and dynamic SQL is checked
When I want to apply the filter, I am trying to follow the example in the Powerpoint doc so instead of doing:
Code: Select all
tables.MYDBRESOURCE.WHERECLAUSE.value="WHERE Status=" + fields.Status.value;
Code: Select all
tables.MYDBRESOURCE.WHERECLAUSE.value="WHERE Status=&&Status";
Field substitution error, reference to field Status which does not exist in resource MYDBRESOURCE
I should mention that this where clause is going to be built based on the value of a few filters, not just one filter field.
What am I doing wrong ?