SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
POWERPOINT

  PRESENTATION ON

PROCEDURE & FUNCTION
Procedures

A procedure is a block of statements
enclosed by some declaration statement with
control blocks and a matching declaration.
All executable statements is must be written
by some procedure.
Why to Create a Procedure

 It allow you to break your program into discrete logical
units, each of which can be debug more easily than an
entire program without procedures.
 It can also use as a building block for other programs.
 If you have code that performs the same task in
different places, you can write the task once as a
procedure and then call it from different places in your
code.
Types of Sub Procedure


General Procedure  It tells the application how
to perform a specific task. It may invoke
another application (function).
Event Procedure  Event procedures execute in
response to an event raised by user action or by
an occurrence in a program such as click event
of an object.
Function

A Function is a series of statements enclosed by the
certain module (of that system) and End Function
statements.
The Function procedure performs a task and then returns
control to the calling code. When it returns control, it
also may return a value to the calling module.
Parts of a Function
A Function has these parts:


Name Anything you like as long as it starts with a letter and
contains only letters numbers and underscores. (without any
space).
Argument List a list of the items of data that the function
needs.
Return Type if the type is Function this tells the compiler
what kind of thing will be returned, for instance, single row or
multi-row , group by etc.
Body all the statements that do the work is as sub procedure.
Passing by value (By Value): The procedure gets a copy
of the actual value of the argument.
function (number x)

Passing by reference (By Reference): The procedure
gets access to the argument's actual memory address.
function (number & x )

When a by reference parameter is used, the value of the
passed argument can be permanently changed by the
procedure.
Example of Procedure
declare
a number;
b number;
c number;
begin
a:=&a;
b:=&b;
c:=a+b;
dbms_output.put_line('a+b:');
dbms_output.put_line(c);
end;/
Example of Function Procedure
Some of the commonly used aggregate functions are :
• SUM
• COUNT
• AVG
• MIN
• MAX

declare
c number;
begin
select avg(sal) into c from EMPLOYEE;
dbms_output.put_line(c);
end;
/
Bibliography
• guidance from teachers
•internet
•books and other friends


This is presented to you by:
Avishek Chatterjee & Aatish Kumar Upaddhay

More Related Content

PPTX
PPTX
PL/SQL - CURSORS
PPTX
Object Oriented Programming with C#
PPTX
Java swing
PPT
Input output streams
PPTX
Exception handling c++
PPTX
Polymorphism in c++(ppt)
PPTX
Templates in c++
PL/SQL - CURSORS
Object Oriented Programming with C#
Java swing
Input output streams
Exception handling c++
Polymorphism in c++(ppt)
Templates in c++

What's hot (20)

PPTX
Packages in PL/SQL
PPTX
Object Oriented Programming Using C++
PDF
Database users
PDF
ODP
Garbage collection
PPTX
Windows form application - C# Training
PPTX
PPTX
Types Of Keys in DBMS
PPTX
classes and objects in C++
PPTX
SUBQUERIES.pptx
PPTX
Function C programming
PPTX
Inheritance in java
PPTX
Python Functions
PPTX
Encapsulation C++
PPTX
Constructors in C++
PPTX
SQL Commands
PPTX
Modular programming
PPTX
Function template
PPT
Sql ppt
Packages in PL/SQL
Object Oriented Programming Using C++
Database users
Garbage collection
Windows form application - C# Training
Types Of Keys in DBMS
classes and objects in C++
SUBQUERIES.pptx
Function C programming
Inheritance in java
Python Functions
Encapsulation C++
Constructors in C++
SQL Commands
Modular programming
Function template
Sql ppt
Ad

Similar to Function & procedure (20)

PPT
Lecture 11 - Functions
PPTX
c & c++ logic building concepts practice.pptx
PDF
All chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
PPTX
04. WORKING WITH FUNCTIONS-2 (1).pptx
PPTX
Functions in C++
PDF
VIT351 Software Development VI Unit1
PPT
Ch4 functions
DOCX
Introduction to c programming
PPTX
Function
PPTX
User defined function in C.pptx
PPTX
Functionincprogram
PDF
cp Module4(1)
PPTX
Unit 1
PDF
Chapter 11 Function
PPTX
Subprogramms
PPTX
Unit_5Functionspptx__2022_12_27_10_47_17 (1).pptx
PPTX
Functions
PPTX
Lecture_5_-_Functions_in_C_Detailed.pptx
DOC
4. function
DOCX
Functions assignment
Lecture 11 - Functions
c & c++ logic building concepts practice.pptx
All chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
04. WORKING WITH FUNCTIONS-2 (1).pptx
Functions in C++
VIT351 Software Development VI Unit1
Ch4 functions
Introduction to c programming
Function
User defined function in C.pptx
Functionincprogram
cp Module4(1)
Unit 1
Chapter 11 Function
Subprogramms
Unit_5Functionspptx__2022_12_27_10_47_17 (1).pptx
Functions
Lecture_5_-_Functions_in_C_Detailed.pptx
4. function
Functions assignment
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
Teaching material agriculture food technology
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Review of recent advances in non-invasive hemoglobin estimation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
Understanding_Digital_Forensics_Presentation.pptx
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Teaching material agriculture food technology
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Function & procedure

  • 1. POWERPOINT PRESENTATION ON PROCEDURE & FUNCTION
  • 2. Procedures A procedure is a block of statements enclosed by some declaration statement with control blocks and a matching declaration. All executable statements is must be written by some procedure.
  • 3. Why to Create a Procedure It allow you to break your program into discrete logical units, each of which can be debug more easily than an entire program without procedures. It can also use as a building block for other programs. If you have code that performs the same task in different places, you can write the task once as a procedure and then call it from different places in your code.
  • 4. Types of Sub Procedure General Procedure  It tells the application how to perform a specific task. It may invoke another application (function). Event Procedure  Event procedures execute in response to an event raised by user action or by an occurrence in a program such as click event of an object.
  • 5. Function A Function is a series of statements enclosed by the certain module (of that system) and End Function statements. The Function procedure performs a task and then returns control to the calling code. When it returns control, it also may return a value to the calling module.
  • 6. Parts of a Function A Function has these parts: Name Anything you like as long as it starts with a letter and contains only letters numbers and underscores. (without any space). Argument List a list of the items of data that the function needs. Return Type if the type is Function this tells the compiler what kind of thing will be returned, for instance, single row or multi-row , group by etc. Body all the statements that do the work is as sub procedure.
  • 7. Passing by value (By Value): The procedure gets a copy of the actual value of the argument. function (number x) Passing by reference (By Reference): The procedure gets access to the argument's actual memory address. function (number & x ) When a by reference parameter is used, the value of the passed argument can be permanently changed by the procedure.
  • 8. Example of Procedure declare a number; b number; c number; begin a:=&a; b:=&b; c:=a+b; dbms_output.put_line('a+b:'); dbms_output.put_line(c); end;/
  • 9. Example of Function Procedure Some of the commonly used aggregate functions are : • SUM • COUNT • AVG • MIN • MAX declare c number; begin select avg(sal) into c from EMPLOYEE; dbms_output.put_line(c); end; /
  • 10. Bibliography • guidance from teachers •internet •books and other friends This is presented to you by: Avishek Chatterjee & Aatish Kumar Upaddhay