Function & Procedure ×
Shani Tiwari - 1039
Devendrakumar Mali - 1003
• CREATE OR REPLACE FUNCTION Function_name(PARAMETERS)
• CREATE OR REPLACE PROCEDURE Procedure_name(PARAMETERS)
RETURN
IN
OUT
Why Functions & Procedures are
Important
• Reusability: Write once, use many times.
• Modularity: Break code into smaller.
• Efficiency: Reduce redundancy.
Functions & Procedures Make Programming Easy With :-
What is Function?
The "Returning Hero"
Reusable blocks of code that
can be used to perform specific
tasks
A block of code that returns
a value.
What is Procedure?
The "Task Masters"
block of code that performs an
action but doesn’t return a
value.
specific set of actions or
logic.
CREATE
PROCEDURE
procedure_name
(parameters) IS
BEGIN
-- Logic
END;
IN
OUT
It is return value
When We Use?
It perform specific task like
inserting updating & deleting
Used for tasks like inserting
data, updating records, etc.
Used for calculations or
operations that produce a
result.
Function Procedure
Calculate total salary,
convert currency, etc.
Insert employee data,
update salary, etc.
FUNCTION
PROCEDURE
Thank
You!

Function & Procedure: Function Vs Procedure in PL/SQL

  • 1.
  • 2.
    Shani Tiwari -1039 Devendrakumar Mali - 1003 • CREATE OR REPLACE FUNCTION Function_name(PARAMETERS) • CREATE OR REPLACE PROCEDURE Procedure_name(PARAMETERS) RETURN IN OUT
  • 3.
    Why Functions &Procedures are Important • Reusability: Write once, use many times. • Modularity: Break code into smaller. • Efficiency: Reduce redundancy. Functions & Procedures Make Programming Easy With :-
  • 4.
    What is Function? The"Returning Hero" Reusable blocks of code that can be used to perform specific tasks A block of code that returns a value.
  • 5.
    What is Procedure? The"Task Masters" block of code that performs an action but doesn’t return a value. specific set of actions or logic. CREATE PROCEDURE procedure_name (parameters) IS BEGIN -- Logic END; IN OUT
  • 6.
    It is returnvalue When We Use? It perform specific task like inserting updating & deleting Used for tasks like inserting data, updating records, etc. Used for calculations or operations that produce a result. Function Procedure Calculate total salary, convert currency, etc. Insert employee data, update salary, etc. FUNCTION PROCEDURE
  • 7.