CREATE OR REPLACE FUNCTION fun3(e OUT NUMBER)
RETURN INTEGER IS
BEGIN
  RETURN(1);
END;
/

SELECT fun3(ename) FROM emp;
SELECT fun3 FROM emp;

CREATE OR REPLACE FUNCTION fun4(e IN NUMBER DEFAULT 0, f IN NUMBER DEFAULT 0)
RETURN INTEGER IS
BEGIN
  RETURN(e+2*f);
END;
/

SELECT fun4 FROM emp;
SELECT fun(1) FROM emp;
SELECT fun4(f=>2) FROM emp;

CREATE OR REPLACE FUNCTION fun5(e IN NUMBER)
RETURN INTEGER IS
BEGIN
  UPDATE emp SET sal = sal+1
  WHERE empno = e;
  RETURN(1);
END;
/

SELECT fun5(ename) FROM emp;
