Learn PL/SQL Language

A block structured language that can have multiple blocks in it. Our tutorial includes all topics of PL/SQL language.

PL/SQL Introduction
Control Statements
PLSQL Concepts

Functions in PL/SQL

The PL/SQL Function is very similar to PL/SQL Procedure. The main difference between procedure and a function is, a function must always return a value, and on the other hand a procedure may or may not return a value. Except this, all the other things of PL/SQL procedure are true for PL/SQL function too.

Syntax to create a function:

          
CREATE [OR REPLACE] FUNCTION function_name [parameters]  
[(parameter_name [IN | OUT | IN OUT] type [, ...])]  
RETURN return_datatype  
{IS | AS}  
BEGIN  
   < function_body >  
END [function_name];  

Here:

PL/SQL Function Example

Output :

Addition is: 33
Statement processed.
0.05 seconds

Let's learn Cursors in PL/SQL


Share this page on :