Thursday, March 3, 2011

Function overloading by number of parameters

SET SERVEROUTPUT ON

DECLARE
     FUNCTION getArea(v_radious NUMBER) RETURN NUMBER IS
     l_pi NUMBER := 3.14;
     BEGIN
          RETURN (l_pi *(v_radious ** 2));
     END;
     FUNCTION getArea(v_length NUMBER ,v_width NUMBER) RETURN NUMBER IS
     BEGIN
          RETURN(v_length * v_width);  
     END;
BEGIN
     DBMS_OUTPUT.PUT_LINE('Area of Circle is '|| getArea(6));
     DBMS_OUTPUT.PUT_LINE('Area of Rectangle is '|| getArea(6,4));
END;

No comments:

Post a Comment

External Table

Oracle External Table External tables are defined as tables that do not resides in the database allows you to access data that is stor...