PL/SQL Functions in Oracle


What Is a Function in Oracle?



A function is a named program unit. It consists of three parts:

  • Declaration Part - Defining the function name, calling parameters, return value type, local variables and local procedures. Declaration part is required.
  • Execution Part - Defining execution logic with executable statements. Execution part is required.
  • Exception Part - Defining error handling logics. Exception part is optional.

Here how a complete procedure should look like:

FUNCTION name (parameter_1, parameter_2) RETURN type AS
  -- Declaration statements
  -- Executable statements
  RETURN value;
  -- Error handling statements


Understanding PL/SQL Language Basics

⇒⇒Oracle Database Tutorials

2018-11-29, 938👍, 0💬