SlideShare a Scribd company logo
1
Name:Name:
Pansuriya Chandani V.Pansuriya Chandani V.
ClassClass:: S.Y. B.C.A.S.Y. B.C.A.
Div.Div.:: 33
Roll.NoRoll.No:: 135135
SubSub:: RDBMSRDBMS
CURSOR FOR LOOP
2
CURSOR FOR LOOPCURSOR FOR LOOP
It is with explicte cursor to process
multiple Records .
Syntax:-
FOR <record name> IN <cursor_
name>
LOOP
<loop statement>;
.……………….
END LOOP;
3
*WRITE A PL/SQL BLOCK USING
CURSOR FOR LOOP TO DISPLAY
STUDENT ROLLNO,NAME &
CITY.*
4
DECLARE
CURSOR C.STUD
IS
SELECT ROLLNO,NAME,CITY FROM STUDENT;
// R_STUD C.STUD %ROWTYPE;
BEGIN
//OPEN C.STUD;
FOR R_STUD IN C.STUD
LOOP
DBMS_OUTPUT.PUT_LINE(R_STUD.ROLLNO||’ ‘|| R_STUD
||’ ‘|| R_STUD.CITY);
END LOOP;
END;
/
ADVANTAGE OF CURSOR FORADVANTAGE OF CURSOR FOR
LOOP.LOOP.
 Whenever the cursor For loop is used, the
cursor is not required to be opened,
records fetched, or closed explicitly.
 These operations are done automatically.
 The first time control enters the loop, the
cursor is opened and the first record is
fetched.
 For subsequent iterations in the loop the
next records are fetched one by one.
 After the last fetch the cursor is closed
and control comes out the loop. 5
ADVANTAGE OF CURSOR FORADVANTAGE OF CURSOR FOR
LOOP.LOOP.
 Whenever the cursor For loop is used, the
cursor is not required to be opened,
records fetched, or closed explicitly.
 These operations are done automatically.
 The first time control enters the loop, the
cursor is opened and the first record is
fetched.
 For subsequent iterations in the loop the
next records are fetched one by one.
 After the last fetch the cursor is closed
and control comes out the loop. 5

More Related Content

Viewers also liked

Crime Classification
Crime ClassificationCrime Classification
Crime Classification
pearcereb
 
Tutorial software kenaikan titik didih dan penurunan titik beku
Tutorial software kenaikan titik didih dan penurunan titik bekuTutorial software kenaikan titik didih dan penurunan titik beku
Tutorial software kenaikan titik didih dan penurunan titik bekufarranissa
 
Driverless car controled by mobile
Driverless car controled by mobileDriverless car controled by mobile
Driverless car controled by mobile
Afnan Khan
 
driverless Robot car controlled using GSM
driverless Robot car controlled using GSMdriverless Robot car controlled using GSM
driverless Robot car controlled using GSM
Afnan Khan
 
Aloe vera
Aloe veraAloe vera
English project work
English project workEnglish project work
English project work
Amit Prakash Sahoo
 

Viewers also liked (6)

Crime Classification
Crime ClassificationCrime Classification
Crime Classification
 
Tutorial software kenaikan titik didih dan penurunan titik beku
Tutorial software kenaikan titik didih dan penurunan titik bekuTutorial software kenaikan titik didih dan penurunan titik beku
Tutorial software kenaikan titik didih dan penurunan titik beku
 
Driverless car controled by mobile
Driverless car controled by mobileDriverless car controled by mobile
Driverless car controled by mobile
 
driverless Robot car controlled using GSM
driverless Robot car controlled using GSMdriverless Robot car controlled using GSM
driverless Robot car controlled using GSM
 
Aloe vera
Aloe veraAloe vera
Aloe vera
 
English project work
English project workEnglish project work
English project work
 

Recently uploaded

Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Diana Rendina
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 

Recently uploaded (20)

Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 

135 cursor for loop

  • 1. 1 Name:Name: Pansuriya Chandani V.Pansuriya Chandani V. ClassClass:: S.Y. B.C.A.S.Y. B.C.A. Div.Div.:: 33 Roll.NoRoll.No:: 135135 SubSub:: RDBMSRDBMS
  • 3. CURSOR FOR LOOPCURSOR FOR LOOP It is with explicte cursor to process multiple Records . Syntax:- FOR <record name> IN <cursor_ name> LOOP <loop statement>; .………………. END LOOP; 3
  • 4. *WRITE A PL/SQL BLOCK USING CURSOR FOR LOOP TO DISPLAY STUDENT ROLLNO,NAME & CITY.* 4 DECLARE CURSOR C.STUD IS SELECT ROLLNO,NAME,CITY FROM STUDENT; // R_STUD C.STUD %ROWTYPE; BEGIN //OPEN C.STUD; FOR R_STUD IN C.STUD LOOP DBMS_OUTPUT.PUT_LINE(R_STUD.ROLLNO||’ ‘|| R_STUD ||’ ‘|| R_STUD.CITY); END LOOP; END; /
  • 5. ADVANTAGE OF CURSOR FORADVANTAGE OF CURSOR FOR LOOP.LOOP.  Whenever the cursor For loop is used, the cursor is not required to be opened, records fetched, or closed explicitly.  These operations are done automatically.  The first time control enters the loop, the cursor is opened and the first record is fetched.  For subsequent iterations in the loop the next records are fetched one by one.  After the last fetch the cursor is closed and control comes out the loop. 5
  • 6. ADVANTAGE OF CURSOR FORADVANTAGE OF CURSOR FOR LOOP.LOOP.  Whenever the cursor For loop is used, the cursor is not required to be opened, records fetched, or closed explicitly.  These operations are done automatically.  The first time control enters the loop, the cursor is opened and the first record is fetched.  For subsequent iterations in the loop the next records are fetched one by one.  After the last fetch the cursor is closed and control comes out the loop. 5