Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> BOOLEAN parameter passed to a stored function
Dear all,
The following function takes BOOLEAN parameters:
CREATE OR REPLACE FUNCTION sf_case
(i_case1 IN BOOLEAN DEFAULT FALSE,
i_case2 IN BOOLEAN DEFAULT FALSE)
RETURN INTEGER
IS
v_result INTEGER;
BEGIN
IF i_case1 THEN
v_result := 1;
ELSIF i_case2 THEN
v_result := 2;
ELSE
v_result := 0;
END IF;
RETURN v_result;
END;
/
However, when I try it in SQL*Plus, logical expressions cannot be evaluated before passed into the stored function: (only literal TRUE and FALSE will be accepted)
SQL> SELECT SF_CASE(2>1,2>1) FROM DUAL;
SELECT SF_CASE(2>1,2>1) FROM DUAL
*
Anyone can help? (Oracle 8.0.5) Thanks in advance.
Dino Received on Sat Jun 02 2001 - 12:56:24 CDT