Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
23 views
11 pages
Cursors and Its Usage
Uploaded by
Sai Dhanush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download
Save
Save Cursors and Its Usage For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
23 views
11 pages
Cursors and Its Usage
Uploaded by
Sai Dhanush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Cursors and Its Usage For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Cursors and Its Usage For Later
You are on page 1
/ 11
Search
Fullscreen
Cursors And Its Usage
G.SAI DHANUSH
237R5A0527
DBMS
SlideMake.com
Introduction to Cursors
Cursors are database objects used to retrieve
and manipulate data in a set.
They are commonly used in SQL programming
to navigate through a result set.
Cursors provide a way to process individual
rows of a query result one at a time.
Types of Cursors
There are three types of cursors in SQL:
forward-only, static, and dynamic.
Forward-only cursors allow fetching rows only
in a forward direction.
Static cursors create a temporary copy of the
data and are not affected by changes made to
the underlying data.
Types of Cursors (cont.)
Dynamic cursors reflect changes made to the
underlying data when fetched.
Cursors can also be classified as read-only or
updatable, depending on whether they allow
modifications to the data.
Choosing the appropriate cursor type is crucial
for efficient data processing.
Declaring and Opening Cursors
To use a cursor in SQL, you first need to declare
it using a DECLARE statement.
After declaration, the cursor is opened using the
OPEN statement to execute the associated
query.
Opening a cursor establishes a result set that can
be navigated using FETCH statements.
Fetching Data with Cursors
Once a cursor is opened, data can be retrieved
row by row using FETCH statements.
The FETCH statement moves the cursor
position to the next row in the result set.
Cursors provide granular control over data
retrieval and processing.
Closing Cursors
After processing data with a cursor, it is
essential to close the cursor using the CLOSE
statement.
Closing a cursor releases the resources
associated with it and frees up memory.
Failing to close a cursor can lead to memory
leaks and performance issues.
Cursor Limitations
Cursors can be inefficient for processing large
result sets due to their row-by-row processing
nature.
They may also lead to performance issues and
increased server load.
It is recommended to use set-based operations
instead of cursors whenever possible for better
performance.
Best Practices for Cursor Usage
Minimize the use of cursors by opting for set-
based operations like JOINs and subqueries.
Use cursors only when necessary for specific
row-level processing tasks.
Always remember to close the cursor after
completing the data processing to prevent
resource leaks.
Conclusion
Cursors are valuable tools for navigating and
processing data in SQL programming.
Understanding the types of cursors and their
appropriate usage is crucial for efficient
database operations.
By following best practices and considering the
limitations of cursors, developers can optimize
their data processing workflows.
THANK
YOU
You might also like
DB2 Cursor
PDF
100% (2)
DB2 Cursor
18 pages
Cursor in DB2
PDF
No ratings yet
Cursor in DB2
41 pages
Cursors in SQL
PDF
No ratings yet
Cursors in SQL
5 pages
What Is CURSOR in PL
PDF
No ratings yet
What Is CURSOR in PL
5 pages
PLSQL 5 1 SG
PDF
No ratings yet
PLSQL 5 1 SG
39 pages
Oracle 10g Cursor Concepts
PDF
100% (1)
Oracle 10g Cursor Concepts
11 pages
Cursor in SQL
PDF
No ratings yet
Cursor in SQL
3 pages
Unit 4
PDF
No ratings yet
Unit 4
23 pages
Cursors
PDF
No ratings yet
Cursors
4 pages
Procedural SQL - Part2: Database Management Systems II
PDF
No ratings yet
Procedural SQL - Part2: Database Management Systems II
21 pages
Choice Hotels
PDF
No ratings yet
Choice Hotels
17 pages
Stored Procedure Iterate
PDF
No ratings yet
Stored Procedure Iterate
8 pages
Under The Guidance of Mr. R.L.Kadam: Maharashtra State Board of Technical Education Mumbai
PDF
No ratings yet
Under The Guidance of Mr. R.L.Kadam: Maharashtra State Board of Technical Education Mumbai
14 pages
5.2 PLSQL Chapter 5 PDF
PDF
No ratings yet
5.2 PLSQL Chapter 5 PDF
7 pages
Cursors
PDF
No ratings yet
Cursors
28 pages
Cursor in SQL Server
PDF
No ratings yet
Cursor in SQL Server
9 pages
Scroll Cursors 2
PDF
No ratings yet
Scroll Cursors 2
12 pages
CURSOR
PDF
No ratings yet
CURSOR
8 pages
PL SQL Cursor
PDF
No ratings yet
PL SQL Cursor
3 pages
Cursors
PDF
No ratings yet
Cursors
6 pages
Scrollable and Non-Scrollable Cursors
PDF
No ratings yet
Scrollable and Non-Scrollable Cursors
12 pages
SQLDEV320A Week 9-1
PDF
No ratings yet
SQLDEV320A Week 9-1
38 pages
Using The Multiple-Row FETCH Statement: Step 1:declare A Cursor
PDF
No ratings yet
Using The Multiple-Row FETCH Statement: Step 1:declare A Cursor
5 pages
CURSOR
PDF
No ratings yet
CURSOR
9 pages
Working With Cursors
PDF
No ratings yet
Working With Cursors
3 pages
Cursors: How To Step Through The Returned Set of Rows
PDF
No ratings yet
Cursors: How To Step Through The Returned Set of Rows
12 pages
Cursor
PDF
No ratings yet
Cursor
33 pages
3 Cursors
PDF
No ratings yet
3 Cursors
7 pages
CURSORS
PDF
No ratings yet
CURSORS
5 pages
Cursors Lecture
PDF
No ratings yet
Cursors Lecture
30 pages
Cursors & Triggers
PDF
No ratings yet
Cursors & Triggers
48 pages
Week-6-Accessing Databases
PDF
No ratings yet
Week-6-Accessing Databases
11 pages
Cursor in SQL Server
PDF
No ratings yet
Cursor in SQL Server
3 pages
SQL Misc 2
PDF
No ratings yet
SQL Misc 2
5 pages
Oracle 8i ch18
PDF
No ratings yet
Oracle 8i ch18
14 pages
SQL cursorsMCA1B
PDF
No ratings yet
SQL cursorsMCA1B
2 pages
Les 05
PDF
No ratings yet
Les 05
24 pages
What Is Cursor? Define Different Type of Cursor?
PDF
No ratings yet
What Is Cursor? Define Different Type of Cursor?
2 pages
BDA Cursores
PDF
No ratings yet
BDA Cursores
38 pages
Using SQL Server Cursors: General Concepts
PDF
No ratings yet
Using SQL Server Cursors: General Concepts
6 pages
Cursor Trigger Merged
PDF
No ratings yet
Cursor Trigger Merged
3 pages
Cursor and Trigger
PDF
No ratings yet
Cursor and Trigger
24 pages
Lecture 6 1
PDF
No ratings yet
Lecture 6 1
25 pages
(Embedded SQL) : What SQL Provides To AS/400 ?
PDF
No ratings yet
(Embedded SQL) : What SQL Provides To AS/400 ?
20 pages
Cours or
PDF
No ratings yet
Cours or
3 pages
SQL Interview Questions 2
PDF
No ratings yet
SQL Interview Questions 2
43 pages
Cursor
PDF
No ratings yet
Cursor
39 pages
DBMS 2 - U 1 CUrsor
PDF
No ratings yet
DBMS 2 - U 1 CUrsor
3 pages
Finals Prep CS405
PDF
No ratings yet
Finals Prep CS405
4 pages
Cursors
PDF
No ratings yet
Cursors
11 pages
Cursor
PDF
No ratings yet
Cursor
7 pages
Practical No.8
PDF
No ratings yet
Practical No.8
2 pages
1.creating Cursor: This Step Allocates Memory: Types of Cursors
PDF
No ratings yet
1.creating Cursor: This Step Allocates Memory: Types of Cursors
7 pages
Cursors Le1
PDF
No ratings yet
Cursors Le1
12 pages
Cursor
PDF
No ratings yet
Cursor
8 pages
Oracle Hyperion Epm Certific
PDF
No ratings yet
Oracle Hyperion Epm Certific
88 pages
Lab Assignment No.10
PDF
No ratings yet
Lab Assignment No.10
3 pages
Lab Report Measuring Diet
PDF
No ratings yet
Lab Report Measuring Diet
26 pages
Cursor Handling
PDF
100% (1)
Cursor Handling
14 pages
Cursor
PDF
No ratings yet
Cursor
3 pages
Groovy Programming
PDF
No ratings yet
Groovy Programming
23 pages
Lecture 2 - Spring Data and Spring Data Rest
PDF
No ratings yet
Lecture 2 - Spring Data and Spring Data Rest
47 pages
Building Information Systems: Managing The Digital Firm, 12 Edition
PDF
100% (1)
Building Information Systems: Managing The Digital Firm, 12 Edition
25 pages
project-II REVIEW 1 BATCH-1
PDF
No ratings yet
project-II REVIEW 1 BATCH-1
20 pages
Household Survey Format - Odisha
PDF
No ratings yet
Household Survey Format - Odisha
3 pages
En GIM 8.5.0 Dep Book PDF
PDF
No ratings yet
En GIM 8.5.0 Dep Book PDF
324 pages
CM 2011 1 Sr2 Installation Guide
PDF
No ratings yet
CM 2011 1 Sr2 Installation Guide
39 pages
50 - Insurance Management System-Synopsis
PDF
No ratings yet
50 - Insurance Management System-Synopsis
6 pages
MCA Syllabus Sri Sri University
PDF
No ratings yet
MCA Syllabus Sri Sri University
38 pages
0523 Pbi
PDF
No ratings yet
0523 Pbi
12 pages
SQL Notes
PDF
No ratings yet
SQL Notes
190 pages
101s Driver Manual
PDF
No ratings yet
101s Driver Manual
129 pages
0525 WT
PDF
No ratings yet
0525 WT
12 pages
Best Practice - Data Consistency Check For Logistics PDF
PDF
No ratings yet
Best Practice - Data Consistency Check For Logistics PDF
68 pages
ClickHouse Grokking
PDF
No ratings yet
ClickHouse Grokking
18 pages
Tutorial: Deploying A SQL Anywhere .NET Application Using ClickOnce PDF
PDF
No ratings yet
Tutorial: Deploying A SQL Anywhere .NET Application Using ClickOnce PDF
25 pages
Online Railway Reservation System 1
PDF
No ratings yet
Online Railway Reservation System 1
5 pages
Atm Srs
PDF
No ratings yet
Atm Srs
12 pages
Coolmay Technical Question Collection
PDF
No ratings yet
Coolmay Technical Question Collection
69 pages
Updated CV
PDF
No ratings yet
Updated CV
2 pages
Function Data Type C: 'Viewproc - Z202Emp - Mview'
PDF
No ratings yet
Function Data Type C: 'Viewproc - Z202Emp - Mview'
9 pages
Frappe Cloud Document and Pricing Erp Scarlet
PDF
No ratings yet
Frappe Cloud Document and Pricing Erp Scarlet
31 pages
A Presentation Report For Programming With Data Visualization
PDF
No ratings yet
A Presentation Report For Programming With Data Visualization
26 pages
MS Access
PDF
No ratings yet
MS Access
19 pages
Project 07 Inventory
PDF
No ratings yet
Project 07 Inventory
3 pages
Types of Graphs Explain Euler Graph With Examples in Destric Mathematics
PDF
No ratings yet
Types of Graphs Explain Euler Graph With Examples in Destric Mathematics
12 pages
CHAPTER 2 - Introduction To Transaction Processing
PDF
No ratings yet
CHAPTER 2 - Introduction To Transaction Processing
7 pages
237R5A0525
PDF
No ratings yet
237R5A0525
10 pages
"Corporate Portal": (An Intranet System For Communication)
PDF
No ratings yet
"Corporate Portal": (An Intranet System For Communication)
5 pages
0527 WT
PDF
No ratings yet
0527 WT
9 pages
Sat - 15.Pdf - Online Subjective Answer Checker
PDF
No ratings yet
Sat - 15.Pdf - Online Subjective Answer Checker
11 pages
DBMS Expr 3
PDF
No ratings yet
DBMS Expr 3
5 pages
C355 1 Team File Submission Team 3 001
PDF
No ratings yet
C355 1 Team File Submission Team 3 001
5 pages
Python Programming - Important - Previously Asked Questions - Python Programming - Study Glancep
PDF
No ratings yet
Python Programming - Important - Previously Asked Questions - Python Programming - Study Glancep
4 pages