Boolean and SELECT
I have a function that simulates if..then..else, and i would like to use this function in select. The test is a boolean var and Oracle cant accept.
How I resolve this problem?
thks
Sergio
---
SELECT IIf('A' in ('A','B','C') and 3 > 2 and 4 between 2 and 5,'TRUE','FALSE')
FROM DUAL;
-- Simula um IF...THEN...ELSE
--
CREATE OR REPLACE FUNCTION IIf(w_bool_exp IN BOOLEAN,
w_true_result IN VARCHAR2,
w_false_result IN VARCHAR2)
RETURN VARCHAR2
IS
BEGIN
IF w_bool_exp THEN
RETURN w_true_result;
ELSIF NOT w_bool_exp THEN
RETURN w_false_result;
ELSE
RETURN NULL;
END IF;
END;