| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> if statement inside function
New to Oracle and cant understand why my code is not working ..
FUNCTION "VARIATION_ID" ("range_id" IN VARCHAR2) return NUMBER is
rangebig NUMBER;
BEGIN
SELECT max(minimum_wage_variation_id) as bigrange into rangebig
FROM minimum_wage_variation
IF range_id = 1 THEN
WHERE minimum_wage_variation_id < 100
ELSE
WHERE minimum_wage_variation_id > 100
END IF;
RETURN rangebig;
END;
error:00933 sql command not properly ended, yet if I put a semicolon on
the where clauses it throws an error on the else clause..
thx.
Dave Received on Wed Feb 15 2006 - 12:24:20 CST
![]() |
![]() |