Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Function Procedure Packages
 

Storing PLSQL function in the Database

create [or replace] function function name (parameters) return ... is  ... begin  ... end; SQL> create or replace   2  function getArea (i_rad NUMBER)   3     return NUMBER   4  is   5      v_pi NUMBER:=3.14;   6  begin   7     return v_pi * (i_rad ** 2);   8  end;   9  / Function created. SQL>