Get circle area : Function Parameters « Stored Procedure Function « Oracle PL / SQL






Get circle area

    

SQL> CREATE OR REPLACE FUNCTION circle_area (p_radius IN NUMBER) RETURN NUMBER AS
  2    v_pi   NUMBER := 3.1415926;
  3    v_area NUMBER;
  4  BEGIN
  5    v_area := v_pi * POWER(p_radius, 2);
  6    RETURN v_area;
  7  END circle_area;
  8  /

Function created.

SQL>
SQL>

   
    
    
    
  








Related examples in the same category

1.Pass value to function parameter
2.Boolean value function parameter
3.The FullName Function
4.A stored function with no parameters.
5.Use Column type as the function parameter type
6.Varray type parameter
7.Clob type parameter
8.Positional Notation
9.Named Notation
10.Pass number value to function
11.Mixed Name and Position Notation Calls