I need to alert when WPM returns particular status codes and this works just fine, but when no matches are found the SWQL query doesn't resolve and just outputs itself into the alert text. When the query doesn't find any results I want it to display 'All is Well'. I've tried using CASE and IS NOT NULL, but rather than returning the text, it just returns nothing.
What am I doing wrong here? I guess returning no rows isn't the same as returning NULL, but I don't know how to get around it.
SELECT
CASE
WHEN StatusStep IS NOT NULL
THEN StatusStep
ELSE 'All is well'
END AS StatusString
FROM
(
SELECT CONCAT ('StepId:', TransactionStepId, ' - StepReqId:',TransactionStepRequestId, ' - StatusCode: ', StatusCode, ' - URL: ', Url ) AS StatusStep
FROM Orion.SEUM.TransactionStepRequests
WHERE TransactionStepId IN (185,186,187)
AND (StatusCode like '4%' or StatusCode like '3%')
)