Hello,
I’m tryng to make a simple filter on a datatable with a named query but I can’t make it works…
I tryed with a simple query like
SELECT * FROM products WHERE product_type=1
I wanto to parameterize the where clause.
So I created a named query with a String parameter named prod_type
The named query will be:
SELECT * FROM products WHERE :prod_type
Then I want to bind the :prod_type parameter to a String property
Something like if the property value is “1=1” the where clause is ever True
and if the property value is “product_type=2” I can see only filtered rows.
The problem is that while testing the parameter of the named query, it works with “1=1” value but it doesn’t work with “product_type=2” value.
Where is the mistake?
Thanks in advance,
Federico