1   declare
  2       a number(2);
  3       b number(2);
  4       c number(2);
  5       function large(x in number,y in number)
  6               return number is z number;
  7       begin
  8       if x>y then
  9               Z:=x;
 10       else
 11               z:=y;
 12       end if;
 13       return z;
 14       end;
 15    begin
 16       a:=10;
 17       b:=20;
 18       c:=large(a,b);
 19       dbms_output.put_line('Largest Number is : '||c);
 20*   end;
SQL> /
Largest Number is : 20

PL/SQL procedure successfully completed.
Advertisements