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 »
Oracle »
PL/SQL »
Functions:
- Create a function
- Call a function with named and mixed notation
- Return the average salary
- Information on Functions
- Dropping a Function
Related: