connect scott/tiger@xe;

create or replace package calculator AS
  function ad (a in NUMBER, b in NUMBER) RETURN NUMBER;
  function sub (a in NUMBER, b in NUMBER) RETURN NUMBER;
  function mul (a in NUMBER, b in NUMBER) RETURN NUMBER;
  function div (a in NUMBER, b in NUMBER) RETURN NUMBER;
end;
/

create or replace package BODY calculator AS

    function ad (a in NUMBER, b in NUMBER) RETURN NUMBER is
    begin
        return a + b;
    end;
      
    function sub (a in NUMBER, b in NUMBER) RETURN NUMBER is
    begin
        return a - b;
    end;        

    function mul (a in NUMBER, b in NUMBER) RETURN NUMBER is
    begin
        return a * b;
    end;

    function div (a in NUMBER, b in NUMBER) RETURN NUMBER is
    begin
        return a / b;
    end;

end calculator;
/
quit;
