Using Birt reporting which allows injecting parameter in a query as follow:
SELECT *
FROM foo
WHERE bar = ?
The question mark comes from a drop down list. Among these values, 'All' can be selected, meaning there are no WHERE clause.
Is there a way to have conditional value in the WHERE clause such as below or an equivalent ?
WHERE
CASE WHEN ? IS NULL
THEN 1=1
ELSE bar = '%'
END
where(bar = ? or ? is null)?