I’m building a complex SQL query and I want to test a result in a while statement.
I want to do something like:
WHERE ( R.Expired IS NULL OR R.Expired > SYSDATE )
AND (
CASE
WHEN R.Description LIKE '%SSX%' THEN TRUE
ELSE FALSE
END
) ORDER BY R.Name
But PL/SQL says it has some “invalid relational operator” (translated).
Is there something wrong with my CASE statement?
The
CASE WHENstuff looks unnecessary to me.Just use
First rule of debugging – avoid unnecessary complexities.