Skip to content

Instantly share code, notes, and snippets.

@leopic
Created November 13, 2014 02:25
Show Gist options
  • Save leopic/84ae5f74f927cfac4836 to your computer and use it in GitHub Desktop.
Save leopic/84ae5f74f927cfac4836 to your computer and use it in GitHub Desktop.
CREATE OR REPLACE FUNCTION factorial(numero IN NUMBER)
RETURN NUMBER
IS resultado NUMBER := 1;
BEGIN
FOR num IN 1..numero LOOP
resultado := resultado * num;
END LOOP;
RETURN (resultado);
END;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment