I am using Pervasive V11. In the following query i have an optional parameter called ModelYear. I would like to exclude it from running in the WHERE clause when it is passed as NULL.
SELECT Year,Make,Style,Model,Color1,VIN
FROM
Vehicles
WHERE
(VIN ='{VIN}') AND (xyz = '{xyz}') AND
(COALESCE(NULLIF('{ModelYear}', ''), Year))
You could try:
From the docs: