Call a function with named and mixed notation

When passing the parameters to a function, the parameters can be set according to its position in the function declaration or by its name:


CREATE FUNCTION circle_area (p_radius IN NUMBER) 
RETURN NUMBER AS
   v_pi NUMBER := 3.1415926;
   v_area NUMBER;
BEGIN
   v_area := v_pi * POWER(p_radius, 2);
   RETURN v_area;
END circle_area;
/

SELECT circle_area(p_radius => 4)
FROM dual;

SELECT circle_area(4)
FROM dual;
Home »
Oracle »
PL/SQL » 

Functions:
  1. Create a function
  2. Call a function with named and mixed notation
  3. Return the average salary
  4. Information on Functions
  5. Dropping a Function
Related: