SlideShare a Scribd company logo
1 of 1
Download to read offline
What is a stored function? Where is it located? How can it be used? Explain
Solution
stored function :-
stored function is nothing but block of code similar to stored procedure which will perform some
operation and returns a single value to the user. stored functions are also called as user defined
functions.
Syntax :-
CREATE OR REPLACE FUNCTION FUNCTION_NAME(PARAMETER DATATYPE)
RETURN(PARAMETER/VARIABLE DATATYPE)
IS/AS
VARIABLE DECLARATION ;
BEGIN
CODE/STATEMENT ;
RETURN(PARAMETER/VARIABLE DATATYPE) ;
END;
/
Example :-
A stored function to return the cube of a given variable value :-
CREATE OR REPLACE FUNCTION F1(X INT)
RETURN INT
IS
BEGIN
RETURN X*X*X ;
END ;
/
Output :-
SELECT F1(5) FROM DUAL ; // Function Call
F1(5)
125.

More Related Content

More from atulkapoor33

What are the three fundamental decisions financial managers make and.pdf
What are the three fundamental decisions financial managers make and.pdfWhat are the three fundamental decisions financial managers make and.pdf
What are the three fundamental decisions financial managers make and.pdfatulkapoor33
 
westphalian order is about what what are the human principle of wes.pdf
westphalian order is about what what are the human principle of wes.pdfwestphalian order is about what what are the human principle of wes.pdf
westphalian order is about what what are the human principle of wes.pdfatulkapoor33
 
Warren Delaney believed that his home was his “castle,” and during t.pdf
Warren Delaney believed that his home was his “castle,” and during t.pdfWarren Delaney believed that his home was his “castle,” and during t.pdf
Warren Delaney believed that his home was his “castle,” and during t.pdfatulkapoor33
 
Understand 1. Explain the factors that contribute to streamflow befor.pdf
Understand 1. Explain the factors that contribute to streamflow befor.pdfUnderstand 1. Explain the factors that contribute to streamflow befor.pdf
Understand 1. Explain the factors that contribute to streamflow befor.pdfatulkapoor33
 
This phenomenon is primarily responsible for the redistribution of he.pdf
This phenomenon is primarily responsible for the redistribution of he.pdfThis phenomenon is primarily responsible for the redistribution of he.pdf
This phenomenon is primarily responsible for the redistribution of he.pdfatulkapoor33
 
The following questions are about transmissible spongiform encephalop.pdf
The following questions are about transmissible spongiform encephalop.pdfThe following questions are about transmissible spongiform encephalop.pdf
The following questions are about transmissible spongiform encephalop.pdfatulkapoor33
 
Please answer these following questions only if you are sure about t.pdf
Please answer these following questions only if you are sure about t.pdfPlease answer these following questions only if you are sure about t.pdf
Please answer these following questions only if you are sure about t.pdfatulkapoor33
 
Multiple choice Which Protozoa phyla is responsible for red tides an.pdf
Multiple choice Which Protozoa phyla is responsible for red tides an.pdfMultiple choice Which Protozoa phyla is responsible for red tides an.pdf
Multiple choice Which Protozoa phyla is responsible for red tides an.pdfatulkapoor33
 
List the 3 Laws of Robotics and decide which is the most important..pdf
List the 3 Laws of Robotics and decide which is the most important..pdfList the 3 Laws of Robotics and decide which is the most important..pdf
List the 3 Laws of Robotics and decide which is the most important..pdfatulkapoor33
 
Mainly stuck on why this is not readily available and used in the Un.pdf
Mainly stuck on why this is not readily available and used in the Un.pdfMainly stuck on why this is not readily available and used in the Un.pdf
Mainly stuck on why this is not readily available and used in the Un.pdfatulkapoor33
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfatulkapoor33
 
IP addresses define the a. Application b. The application port .pdf
IP addresses define the    a. Application  b. The application port  .pdfIP addresses define the    a. Application  b. The application port  .pdf
IP addresses define the a. Application b. The application port .pdfatulkapoor33
 
Identical twins are produced from the same sperm and egg (which split.pdf
Identical twins are produced from the same sperm and egg (which split.pdfIdentical twins are produced from the same sperm and egg (which split.pdf
Identical twins are produced from the same sperm and egg (which split.pdfatulkapoor33
 
Give an example of two variables which have no direct causal connect.pdf
Give an example of two variables which have no direct causal connect.pdfGive an example of two variables which have no direct causal connect.pdf
Give an example of two variables which have no direct causal connect.pdfatulkapoor33
 
Explain how to deal with patient confidentility, integrity and ethic.pdf
Explain how to deal with patient confidentility, integrity and ethic.pdfExplain how to deal with patient confidentility, integrity and ethic.pdf
Explain how to deal with patient confidentility, integrity and ethic.pdfatulkapoor33
 
explain these termsPeristalsisVilliComposition of fecesPeris.pdf
explain these termsPeristalsisVilliComposition of fecesPeris.pdfexplain these termsPeristalsisVilliComposition of fecesPeris.pdf
explain these termsPeristalsisVilliComposition of fecesPeris.pdfatulkapoor33
 
Explain how Lankacidin C has double bonds in its backbone.Solutio.pdf
Explain how Lankacidin C has double bonds in its backbone.Solutio.pdfExplain how Lankacidin C has double bonds in its backbone.Solutio.pdf
Explain how Lankacidin C has double bonds in its backbone.Solutio.pdfatulkapoor33
 
during the evolution of plants, the sporophyte generation becomes do.pdf
during the evolution of plants, the sporophyte generation becomes do.pdfduring the evolution of plants, the sporophyte generation becomes do.pdf
during the evolution of plants, the sporophyte generation becomes do.pdfatulkapoor33
 
Detection of fragmented DNA in apoptotic cells may be performed usin.pdf
Detection of fragmented DNA in apoptotic cells may be performed usin.pdfDetection of fragmented DNA in apoptotic cells may be performed usin.pdf
Detection of fragmented DNA in apoptotic cells may be performed usin.pdfatulkapoor33
 
d lower equal of A chanser prveein does which thr all of the above io.pdf
d lower equal of A chanser prveein does which thr all of the above io.pdfd lower equal of A chanser prveein does which thr all of the above io.pdf
d lower equal of A chanser prveein does which thr all of the above io.pdfatulkapoor33
 

More from atulkapoor33 (20)

What are the three fundamental decisions financial managers make and.pdf
What are the three fundamental decisions financial managers make and.pdfWhat are the three fundamental decisions financial managers make and.pdf
What are the three fundamental decisions financial managers make and.pdf
 
westphalian order is about what what are the human principle of wes.pdf
westphalian order is about what what are the human principle of wes.pdfwestphalian order is about what what are the human principle of wes.pdf
westphalian order is about what what are the human principle of wes.pdf
 
Warren Delaney believed that his home was his “castle,” and during t.pdf
Warren Delaney believed that his home was his “castle,” and during t.pdfWarren Delaney believed that his home was his “castle,” and during t.pdf
Warren Delaney believed that his home was his “castle,” and during t.pdf
 
Understand 1. Explain the factors that contribute to streamflow befor.pdf
Understand 1. Explain the factors that contribute to streamflow befor.pdfUnderstand 1. Explain the factors that contribute to streamflow befor.pdf
Understand 1. Explain the factors that contribute to streamflow befor.pdf
 
This phenomenon is primarily responsible for the redistribution of he.pdf
This phenomenon is primarily responsible for the redistribution of he.pdfThis phenomenon is primarily responsible for the redistribution of he.pdf
This phenomenon is primarily responsible for the redistribution of he.pdf
 
The following questions are about transmissible spongiform encephalop.pdf
The following questions are about transmissible spongiform encephalop.pdfThe following questions are about transmissible spongiform encephalop.pdf
The following questions are about transmissible spongiform encephalop.pdf
 
Please answer these following questions only if you are sure about t.pdf
Please answer these following questions only if you are sure about t.pdfPlease answer these following questions only if you are sure about t.pdf
Please answer these following questions only if you are sure about t.pdf
 
Multiple choice Which Protozoa phyla is responsible for red tides an.pdf
Multiple choice Which Protozoa phyla is responsible for red tides an.pdfMultiple choice Which Protozoa phyla is responsible for red tides an.pdf
Multiple choice Which Protozoa phyla is responsible for red tides an.pdf
 
List the 3 Laws of Robotics and decide which is the most important..pdf
List the 3 Laws of Robotics and decide which is the most important..pdfList the 3 Laws of Robotics and decide which is the most important..pdf
List the 3 Laws of Robotics and decide which is the most important..pdf
 
Mainly stuck on why this is not readily available and used in the Un.pdf
Mainly stuck on why this is not readily available and used in the Un.pdfMainly stuck on why this is not readily available and used in the Un.pdf
Mainly stuck on why this is not readily available and used in the Un.pdf
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdf
 
IP addresses define the a. Application b. The application port .pdf
IP addresses define the    a. Application  b. The application port  .pdfIP addresses define the    a. Application  b. The application port  .pdf
IP addresses define the a. Application b. The application port .pdf
 
Identical twins are produced from the same sperm and egg (which split.pdf
Identical twins are produced from the same sperm and egg (which split.pdfIdentical twins are produced from the same sperm and egg (which split.pdf
Identical twins are produced from the same sperm and egg (which split.pdf
 
Give an example of two variables which have no direct causal connect.pdf
Give an example of two variables which have no direct causal connect.pdfGive an example of two variables which have no direct causal connect.pdf
Give an example of two variables which have no direct causal connect.pdf
 
Explain how to deal with patient confidentility, integrity and ethic.pdf
Explain how to deal with patient confidentility, integrity and ethic.pdfExplain how to deal with patient confidentility, integrity and ethic.pdf
Explain how to deal with patient confidentility, integrity and ethic.pdf
 
explain these termsPeristalsisVilliComposition of fecesPeris.pdf
explain these termsPeristalsisVilliComposition of fecesPeris.pdfexplain these termsPeristalsisVilliComposition of fecesPeris.pdf
explain these termsPeristalsisVilliComposition of fecesPeris.pdf
 
Explain how Lankacidin C has double bonds in its backbone.Solutio.pdf
Explain how Lankacidin C has double bonds in its backbone.Solutio.pdfExplain how Lankacidin C has double bonds in its backbone.Solutio.pdf
Explain how Lankacidin C has double bonds in its backbone.Solutio.pdf
 
during the evolution of plants, the sporophyte generation becomes do.pdf
during the evolution of plants, the sporophyte generation becomes do.pdfduring the evolution of plants, the sporophyte generation becomes do.pdf
during the evolution of plants, the sporophyte generation becomes do.pdf
 
Detection of fragmented DNA in apoptotic cells may be performed usin.pdf
Detection of fragmented DNA in apoptotic cells may be performed usin.pdfDetection of fragmented DNA in apoptotic cells may be performed usin.pdf
Detection of fragmented DNA in apoptotic cells may be performed usin.pdf
 
d lower equal of A chanser prveein does which thr all of the above io.pdf
d lower equal of A chanser prveein does which thr all of the above io.pdfd lower equal of A chanser prveein does which thr all of the above io.pdf
d lower equal of A chanser prveein does which thr all of the above io.pdf
 

Recently uploaded

Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of PlayPooky Knightsmith
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 

Recently uploaded (20)

Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 

What is a stored function Where is it located How can it be used .pdf

  • 1. What is a stored function? Where is it located? How can it be used? Explain Solution stored function :- stored function is nothing but block of code similar to stored procedure which will perform some operation and returns a single value to the user. stored functions are also called as user defined functions. Syntax :- CREATE OR REPLACE FUNCTION FUNCTION_NAME(PARAMETER DATATYPE) RETURN(PARAMETER/VARIABLE DATATYPE) IS/AS VARIABLE DECLARATION ; BEGIN CODE/STATEMENT ; RETURN(PARAMETER/VARIABLE DATATYPE) ; END; / Example :- A stored function to return the cube of a given variable value :- CREATE OR REPLACE FUNCTION F1(X INT) RETURN INT IS BEGIN RETURN X*X*X ; END ; / Output :- SELECT F1(5) FROM DUAL ; // Function Call F1(5) 125.