DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Create And Call An Oracle Function
create or replace function "ORACLE_FOO"
(foo_arg1 in NUMBER)
return NUMBER
is
rt NUMBER := 0;
begin
IF foo_arg1 > 1 THEN
SELECT 1 INTO rt;
ELSE
SELECT 2 INTO rt;
END IF;
RETURN (rt);
end;
SELECT ORACLE_FOO(1) FROM dual;





