Never been to DZone Snippets before?

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

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

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;
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS