SlideShare a Scribd company logo
1 of 33
University Institute of Engineering (UIE)
2
Database
Management
System
CO
Number
Title Level
CO1 To perceive the significance and
implementation of a commercial
relational database system (Oracle)
by writing SQL using the system.
Remember
CO2 To understand the relational database
theory, and be able to write
relational algebra expressions for
queries
Understand
CO3 To identify the basic issues of
transaction processing and
concurrency control and find out its
solutions.
Analysis and
application
Course Outcome Will be covered in
this lecture
Department of Computer Science and Engineering (CSE)
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Contents of the Syllabus
3
UNIT-I [10h]
Overview of Databases: Database concepts, DBMS, Data Base System Architecture (Three
Level ANSI-SPARC Architecture), Advantages and Disadvantages of DBMS, Data Independence,
DBA and Responsibilities of DBA, Relational Data Structure, Keys, Relations, Attributes, Schema and
Instances, Referential integrity, Entity integrity.
Data Models: Relational Model, Network Model, Hierarchical Model, ER Model: Design,
issues, Mapping constraints, ER diagram, Comparison of Models.
Relational Algebra & Relational Calculus: Introduction, Syntax, Semantics, Additional
operators, Grouping and Ungrouping, Relational comparisons, Tuple Calculus, Domain Calculus,
Calculus Vs Algebra, Computational capabilities.
UNIT-II [10h]
Functional dependencies and Normalization: Functional dependencies, Decomposition, Full
Functional Dependency (FFD), Transitive Dependency (TD), Join Dependency (JD), Multi-valued
Dependency (MVD), Normal Forms (1NF, 2NF, 3NF, BCNF), De-normalization.
Database Security: Introduction, Threats, Counter Measures.
Control Structures: Introduction to conditional control, Iterative control and sequential control
statements, Cursors, Views.
Department of Computer Science and Engineering (CSE)
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Contents of the Syllabus
4
UNIT-III
[10h]
Package, Procedures and Triggers: Parts of procedures, Parameter modes, Advantages of
procedures, Syntax for creating triggers, Types of triggers, package specification and package body,
developing a package, Bodiless package, Advantages of packages.
Transaction Management and Concurrency Control: Introduction to Transaction Processing,
Properties of Transactions, Serializability and Recoverability, Need for Concurrency Control, Locking
Techniques, Time Stamping Methods, Optimistic Techniques and Granularity of Data items.
Database Recovery of database: Introduction, Need for Recovery, Types of errors, Recovery
Techniques.
Department of Computer Science and Engineering (CSE)
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Chapter 2.3
(Control Structures)
Control Structures: Introduction to conditional control, Iterative control and
sequential control statements, Cursors, Views.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Learning Objective
In this chapter, we will briefly cover the following topics:
• Conditional controls
– IF-THEN
– IF-THEN-ELSE, and
– IF-THEN-ELSIF
• Iterative controls
– Simple loops
– WHILE loops
– FOR loops
• Sequential control
• Cursor Manipulation.
• Using Cursor For Loops.
• Using Parameters with Cursors.
• Cursor variables
• Views
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Learning Outcome
• Type of control structure in Database Management
System.
• Discuss the concepts of cursor and its types.
• Discuss views in Database Management System.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Cursor
• A cursor is a pointer to this context area. PL/SQL controls the context area
through a cursor. A cursor holds the rows (one or more) returned by a SQL
statement. The set of rows the cursor holds is referred to as the active set.
There are two types of cursors:
Implicit cursors
Explicit cursors
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Cursor
• A cursor is a temporary work area created in the system memory when a SQL
statement is executed.
• A cursor contains information on a select statement and the rows of data
accessed by it.
• This temporary work area is used to store the data retrieved from the database,
and manipulate this data.
• A cursor can hold more than one row, but can process only one row at a time.
• The set of rows the cursor holds is called the active set.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
NEED FOR CURSORS?
Cursor is a mechanism that provides a way to select multiple rows of data from
the database and then process each row individually inside a PL/SQL program.
The cursor first points at row1 and once it is processed it then
advances to row2 and so on.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Cursor Types
• There are two types of cursors in PL/SQL.
– Implicit cursors.
– Explicit cursors.
• Both implicit and explicit cursors have the same functionality,
but they differ in the way they are accessed.
•Cursor AttributesCursor Attributes
Name Description
%FOUND Returns TRUE if record was fetched successfully, FALSE otherwise.
%NOTFOUND Returns TRUE if record was not fetched successfully, FALSE otherwise.
%ROWCOUNT Returns number of records fetched from cursor at that point in time.
%ISOPEN Returns TRUE if cursor is open, FALSE otherwise.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Implicit Cursors
• Implicit cursors are automatically created by Oracle whenever an SQL
statement is executed, when there is no explicit cursor for the statement.
Programmers cannot control the implicit cursors and the information in
it.
• Implicit cursors are automatically created by Oracle whenever an SQL
statement is executed, when there is no explicit cursor for the statement.
• Whenever a DML statement (INSERT, UPDATE and DELETE) is
issued, an implicit cursor is associated with this statement.
• For INSERT operations, the cursor holds the data that needs to be
inserted.
• For UPDATE and DELETE operations, the cursor identifies the rows
that would be affected.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Implicit Cursors
• These are created by default when DML statements like,
INSERT, UPDATE, and DELETE statements are executed.
• The user is not aware of this happening & will not be able
to control or process the information.
• When an implicit cursor is working, DBMS performs the
open, fetches and close automatically
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
The following table provides the description of the most used
attributes −
Attribute Name Description
%ISOPEN
Returns TRUE if cursor is open, FALSE if cursor is closed.
SQL%ISOPEN always returns FALSE.
%FOUND
Returns TRUE if successful fetch has been executed, FALSE if no row was
returned. SQL%FOUND is used to access it.
%NOTFOUND
Return TRUE if no row was returned, FALSE if successful fetch has been
executed. SQL%NOTFOUND is used to access it.
%ROWCOUNT
Returns the number of rows affected by the query.
SQL%ROWCOUNT is used to access it.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Example
• The following program will update the table and increase the
salary of each customer by 500 and use
the SQL%ROWCOUNT attribute to determine the number
of rows affected.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Example
• DECLARE
• total_rows number(2);
• BEGIN UPDATE customers SET salary = salary + 500;
• IF sql%notfound THEN
• dbms_output.put_line('no customers selected');
• ELSIF sql%found THEN
• total_rows := sql%rowcount; dbms_output.put_line(
total_rows || ' customers selected');
• END IF;
• END; /
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Result:
6 customers selected
PL/SQL procedure successfully completed.
Select * from customers;
+‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+
| ID | NAME | AGE | ADDRESS | SALARY |
+‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+
| 1 | Ramesh | 32 | Ahmedabad | 2500.00 |
| 2 | Khilan | 25 | Delhi | 2000.00 |
| 3 | kaushik | 23 | Kota | 2500.00 |
| 4 | Chaitali | 25 | Mumbai | 7000.00 |
| 5 | Hardik | 27 | Bhopal | 9000.00 |
| 6 | Komal | 22 | MP | 5000.00 |
+‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Explicit Cursors
• Explicit cursors are programmer defined cursors for gaining more control
over the context area. An explicit cursor should be defined in the
declaration section of the PL/SQL Block. It is created on a SELECT
Statement which returns more than one row.
Working with an explicit cursor involves four steps:
– Declaring the cursor for initializing in the memory
– Opening the cursor for allocating memory
– Fetching the cursor for retrieving data
– Closing the cursor to release allocated memory
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Explicit Cursor
• Declaring the cursor defines the cursor with a name and the
associated SELECT statement.
• Syntax: CURSOR c_customers IS SELECT id, name, address
FROM customers;
• Opening the cursor allocates the memory for the cursor and makes
it ready for fetching the rows returned by the SQL statement into
it.
• Syntax: OPEN c_customers;
• Fetching the cursor involves accessing one row at a time.
• Syntax: FETCH c_customers INTO c_id, c_name, c_addr;
• Closing the cursor means releasing the allocated memory.
• CLOSE c_customers;
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Explicit cursors
• Explicit cursors are programmer defined cursors for
gaining more control over the context area.
• An explicit cursor should be defined in the declaration
section of the PL/SQL Block.
• It is created on a SELECT Statement which returns more
than one row.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
The following table provides the description of the most
used attributes −
Attribute Name Description
%ISOPEN
Returns TRUE if cursor is open, FALSE if cursor is closed.
CursorName%ISOPEN is used to access it.
%FOUND
Returns TRUE if successful fetch has been executed, FALSE if no row was
returned.
CursorName%FOUND is used to access it.
%NOTFOUND
Return TRUE if no row was returned, FALSE if successful fetch has been
executed.
CursorName%NOTFOUND is used to access it.
%ROWCOUNT
Returns the number of rows affected by the query.
CursorName%ROWCOUNT is used to access it.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Explicit cursor involves four steps:
1.Declaring the cursor for initializing in the memory
2.Opening the cursor for allocating memory
3.Fetching the cursor for retrieving data
4.Closing the cursor to release allocated memory
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
STEPS
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Declaring the Cursor
Syntax:
• CURSOR cursor_name IS select_statement;
For example:
• CURSOR c_customers IS
• SELECT id, name, address FROM customers;
Opening the Cursor
Syntax:
• OPEN cursor_name;
Example:
• OPEN c_customers;
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Fetching the Cursor
• Fetching the cursor involves accessing one row at a time.
Syntax:
• FETCH cursor_name INTO record_name;
Example:
• FETCH c_customers INTO c_id, c_name, c_addr;
Closing the Cursor
• Closing the cursor means releasing the allocated memory.
Syntax:
• CLOSE cursor_name;
Example:
• CLOSE c_customers;
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
EXAMPLE
• DECLARE
• c_id customers.id%type;
• c_name customers.name%type;
• c_addr customers.address%type;
• CURSOR c_customers IS SELECT id, name, address FROM customers;
• BEGIN
• OPEN c_customers;
• LOOP
• FETCH c_customers into c_id, c_name, c_addr;
• EXIT WHEN c_customers%notfound;
• dbms_output.put_line(c_id || ' ' || c_name || ' ' || c_addr);
• END LOOP;
• CLOSE c_customers;
• END;
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
RESULT:
1 Ramesh Ahmedabad
2 Khilan Delhi
3 kaushik Kota
4 Chaitali Mumbai
5 Hardik Bhopal
6 Komal MP
PL/SQL procedure successfully completed.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Cursor Attributes
• cursorname%ROWCOUNT Rows returned so far
• cursorname%FOUND One or more rows retrieved
• cursorname%NOTFOUND No rows found
• Cursorname%ISOPEN Is the cursor open
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Implicit cursor
Oracle Tutorials: PL/SQL
DECLARE
l_rows number(5);
BEGIN
UPDATE employee SET salary = salary + 1000;
IF SQL%NOTFOUND THEN
dbms_output.put_line('None of the salaries where updated');
ELSIF SQL%FOUND THEN l_rows := SQL%ROWCOUNT;
dbms_output.put_line('Salaries for ' || l_rows ||
'employees are updated');
END IF;
END;
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Using explicit cursors
Oracle Tutorials: PL/SQL
• Fetching results of a query into RECORD
DECLARE
l_employees employees%ROWTYPE;
CURSOR l_c (p_low NUMBER DEFAULT 0, p_high NUMBER DEFAULT 99) is
SELECT * FROM employees WHERE job_id > p_low AND job_id < p_high;
BEGIN
OPEN l_c(3,20);
LOOP
FETCH l_c INTO l_employees;
EXIT WHEN l_c%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(l_employees.last_name || l_employees.job_id );
END LOOP;
CLOSE l_c;
END;
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Advantages
• Using Cursor we can perform row by row processing .
• We can perform row wise validation or operations on
each
row.
• Allow application to access and move around in a set of
data rows, rather then merely retrieve a complete result
set.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Disadvantages
• Uses more resources
• Speed and performance issues.
• Increased network roundtrip.
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
Answers:1.d, 2.b
33
HOME WORK
1 ____ are declared and manipulated in the PL/SQL block code for
handling a set of rows returned by a SELECT statement.
a. Explicit cursors
b. Dynamic cursors
c. static cursors
d. Implicit cursors
2. The ____ action used with an explicit cursor creates a named
cursor identified by a SELECT statement.
a. OPEN
b. DECLARE
c. FETCH
d. CLOSE
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)
References
Other References
• PL/SQL - Cursors - Tutorialspoint
• PL/SQL Cursor - javatpoint
• PL/SQL Cursor (plsqltutorial.com)
•
Suggested Book References
• C.J.Date, “An Introduction to DatabaseSystems”, Addison
Wesley.
• Thomas M. Connolly, Carolyn & E.Begg,“Database
Systems: A Practical Approach to Design,
Implementationand Management”, 5/E, University of
Paisley, Addison-Wesley.
• Rob,”Database Principal Fundamental Design, Cengage
Learning.
•

More Related Content

Similar to PPT Lecture 2.3.4 Cursortttttttttttttttttttttttttttttttts.pptx

Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusChhom Karath
 
Lecture 2.3.26_Conditional Control Structure.pptx
Lecture 2.3.26_Conditional Control Structure.pptxLecture 2.3.26_Conditional Control Structure.pptx
Lecture 2.3.26_Conditional Control Structure.pptxShivam481778
 
MODEL CHECKERS –TOOLS AND LANGUAGES FOR SYSTEM DESIGN- A SURVEY
MODEL CHECKERS –TOOLS AND LANGUAGES FOR SYSTEM DESIGN- A SURVEYMODEL CHECKERS –TOOLS AND LANGUAGES FOR SYSTEM DESIGN- A SURVEY
MODEL CHECKERS –TOOLS AND LANGUAGES FOR SYSTEM DESIGN- A SURVEYcsandit
 
Database Management System NOTES for 2nd year
Database Management System NOTES for 2nd yearDatabase Management System NOTES for 2nd year
Database Management System NOTES for 2nd yeardhasamalika
 
Day 1 (1).pptx
Day 1 (1).pptxDay 1 (1).pptx
Day 1 (1).pptxuououio
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxNurulIzrin
 
Migrating Legacy Spreadsheets-based Systems to Web MVC architecture: an Indus...
Migrating Legacy Spreadsheets-based Systems to Web MVC architecture: an Indus...Migrating Legacy Spreadsheets-based Systems to Web MVC architecture: an Indus...
Migrating Legacy Spreadsheets-based Systems to Web MVC architecture: an Indus...REvERSE University of Naples Federico II
 
PPT Lecture 1.3 Database System Administrator.pptx
PPT Lecture 1.3 Database System Administrator.pptxPPT Lecture 1.3 Database System Administrator.pptx
PPT Lecture 1.3 Database System Administrator.pptxAbhiGrover10
 
SE-IT DSA THEORY SYLLABUS
SE-IT DSA THEORY SYLLABUSSE-IT DSA THEORY SYLLABUS
SE-IT DSA THEORY SYLLABUSnikshaikh786
 
files_1570175665_204715750.pdf
files_1570175665_204715750.pdffiles_1570175665_204715750.pdf
files_1570175665_204715750.pdfbeherapravat936
 
CIS-(Data Structures and Algorithms)FALL2023.pdf
CIS-(Data Structures and Algorithms)FALL2023.pdfCIS-(Data Structures and Algorithms)FALL2023.pdf
CIS-(Data Structures and Algorithms)FALL2023.pdfShayanAamir2
 
Machine Learning and AI at Oracle
Machine Learning and AI at OracleMachine Learning and AI at Oracle
Machine Learning and AI at OracleSandesh Rao
 
Machine learning with R
Machine learning with RMachine learning with R
Machine learning with RMaarten Smeets
 
Unit 3 rdbms study_materials-converted
Unit 3  rdbms study_materials-convertedUnit 3  rdbms study_materials-converted
Unit 3 rdbms study_materials-convertedgayaramesh
 
II B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptxII B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptxsabithabanu83
 

Similar to PPT Lecture 2.3.4 Cursortttttttttttttttttttttttttttttttts.pptx (20)

Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
 
Lecture 2.3.26_Conditional Control Structure.pptx
Lecture 2.3.26_Conditional Control Structure.pptxLecture 2.3.26_Conditional Control Structure.pptx
Lecture 2.3.26_Conditional Control Structure.pptx
 
MODEL CHECKERS –TOOLS AND LANGUAGES FOR SYSTEM DESIGN- A SURVEY
MODEL CHECKERS –TOOLS AND LANGUAGES FOR SYSTEM DESIGN- A SURVEYMODEL CHECKERS –TOOLS AND LANGUAGES FOR SYSTEM DESIGN- A SURVEY
MODEL CHECKERS –TOOLS AND LANGUAGES FOR SYSTEM DESIGN- A SURVEY
 
Intro_2.ppt
Intro_2.pptIntro_2.ppt
Intro_2.ppt
 
Intro.ppt
Intro.pptIntro.ppt
Intro.ppt
 
Intro.ppt
Intro.pptIntro.ppt
Intro.ppt
 
Database Management System NOTES for 2nd year
Database Management System NOTES for 2nd yearDatabase Management System NOTES for 2nd year
Database Management System NOTES for 2nd year
 
Day 1 (1).pptx
Day 1 (1).pptxDay 1 (1).pptx
Day 1 (1).pptx
 
EC6703 unit-4
EC6703 unit-4EC6703 unit-4
EC6703 unit-4
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptx
 
Migrating Legacy Spreadsheets-based Systems to Web MVC architecture: an Indus...
Migrating Legacy Spreadsheets-based Systems to Web MVC architecture: an Indus...Migrating Legacy Spreadsheets-based Systems to Web MVC architecture: an Indus...
Migrating Legacy Spreadsheets-based Systems to Web MVC architecture: an Indus...
 
PPT Lecture 1.3 Database System Administrator.pptx
PPT Lecture 1.3 Database System Administrator.pptxPPT Lecture 1.3 Database System Administrator.pptx
PPT Lecture 1.3 Database System Administrator.pptx
 
SE-IT DSA THEORY SYLLABUS
SE-IT DSA THEORY SYLLABUSSE-IT DSA THEORY SYLLABUS
SE-IT DSA THEORY SYLLABUS
 
files_1570175665_204715750.pdf
files_1570175665_204715750.pdffiles_1570175665_204715750.pdf
files_1570175665_204715750.pdf
 
CIS-(Data Structures and Algorithms)FALL2023.pdf
CIS-(Data Structures and Algorithms)FALL2023.pdfCIS-(Data Structures and Algorithms)FALL2023.pdf
CIS-(Data Structures and Algorithms)FALL2023.pdf
 
Machine Learning and AI at Oracle
Machine Learning and AI at OracleMachine Learning and AI at Oracle
Machine Learning and AI at Oracle
 
Machine learning with R
Machine learning with RMachine learning with R
Machine learning with R
 
Unit 3 rdbms study_materials-converted
Unit 3  rdbms study_materials-convertedUnit 3  rdbms study_materials-converted
Unit 3 rdbms study_materials-converted
 
II B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptxII B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptx
 
Day5
Day5Day5
Day5
 

Recently uploaded

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 

Recently uploaded (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

PPT Lecture 2.3.4 Cursortttttttttttttttttttttttttttttttts.pptx

  • 1. University Institute of Engineering (UIE) 2 Database Management System CO Number Title Level CO1 To perceive the significance and implementation of a commercial relational database system (Oracle) by writing SQL using the system. Remember CO2 To understand the relational database theory, and be able to write relational algebra expressions for queries Understand CO3 To identify the basic issues of transaction processing and concurrency control and find out its solutions. Analysis and application Course Outcome Will be covered in this lecture Department of Computer Science and Engineering (CSE)
  • 2. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Contents of the Syllabus 3 UNIT-I [10h] Overview of Databases: Database concepts, DBMS, Data Base System Architecture (Three Level ANSI-SPARC Architecture), Advantages and Disadvantages of DBMS, Data Independence, DBA and Responsibilities of DBA, Relational Data Structure, Keys, Relations, Attributes, Schema and Instances, Referential integrity, Entity integrity. Data Models: Relational Model, Network Model, Hierarchical Model, ER Model: Design, issues, Mapping constraints, ER diagram, Comparison of Models. Relational Algebra & Relational Calculus: Introduction, Syntax, Semantics, Additional operators, Grouping and Ungrouping, Relational comparisons, Tuple Calculus, Domain Calculus, Calculus Vs Algebra, Computational capabilities. UNIT-II [10h] Functional dependencies and Normalization: Functional dependencies, Decomposition, Full Functional Dependency (FFD), Transitive Dependency (TD), Join Dependency (JD), Multi-valued Dependency (MVD), Normal Forms (1NF, 2NF, 3NF, BCNF), De-normalization. Database Security: Introduction, Threats, Counter Measures. Control Structures: Introduction to conditional control, Iterative control and sequential control statements, Cursors, Views. Department of Computer Science and Engineering (CSE)
  • 3. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Contents of the Syllabus 4 UNIT-III [10h] Package, Procedures and Triggers: Parts of procedures, Parameter modes, Advantages of procedures, Syntax for creating triggers, Types of triggers, package specification and package body, developing a package, Bodiless package, Advantages of packages. Transaction Management and Concurrency Control: Introduction to Transaction Processing, Properties of Transactions, Serializability and Recoverability, Need for Concurrency Control, Locking Techniques, Time Stamping Methods, Optimistic Techniques and Granularity of Data items. Database Recovery of database: Introduction, Need for Recovery, Types of errors, Recovery Techniques. Department of Computer Science and Engineering (CSE)
  • 4. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Chapter 2.3 (Control Structures) Control Structures: Introduction to conditional control, Iterative control and sequential control statements, Cursors, Views.
  • 5. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Learning Objective In this chapter, we will briefly cover the following topics: • Conditional controls – IF-THEN – IF-THEN-ELSE, and – IF-THEN-ELSIF • Iterative controls – Simple loops – WHILE loops – FOR loops • Sequential control • Cursor Manipulation. • Using Cursor For Loops. • Using Parameters with Cursors. • Cursor variables • Views
  • 6. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Learning Outcome • Type of control structure in Database Management System. • Discuss the concepts of cursor and its types. • Discuss views in Database Management System.
  • 7. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Cursor • A cursor is a pointer to this context area. PL/SQL controls the context area through a cursor. A cursor holds the rows (one or more) returned by a SQL statement. The set of rows the cursor holds is referred to as the active set. There are two types of cursors: Implicit cursors Explicit cursors
  • 8. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Cursor • A cursor is a temporary work area created in the system memory when a SQL statement is executed. • A cursor contains information on a select statement and the rows of data accessed by it. • This temporary work area is used to store the data retrieved from the database, and manipulate this data. • A cursor can hold more than one row, but can process only one row at a time. • The set of rows the cursor holds is called the active set.
  • 9. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) NEED FOR CURSORS? Cursor is a mechanism that provides a way to select multiple rows of data from the database and then process each row individually inside a PL/SQL program. The cursor first points at row1 and once it is processed it then advances to row2 and so on.
  • 10. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Cursor Types • There are two types of cursors in PL/SQL. – Implicit cursors. – Explicit cursors. • Both implicit and explicit cursors have the same functionality, but they differ in the way they are accessed. •Cursor AttributesCursor Attributes Name Description %FOUND Returns TRUE if record was fetched successfully, FALSE otherwise. %NOTFOUND Returns TRUE if record was not fetched successfully, FALSE otherwise. %ROWCOUNT Returns number of records fetched from cursor at that point in time. %ISOPEN Returns TRUE if cursor is open, FALSE otherwise.
  • 11. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Implicit Cursors • Implicit cursors are automatically created by Oracle whenever an SQL statement is executed, when there is no explicit cursor for the statement. Programmers cannot control the implicit cursors and the information in it. • Implicit cursors are automatically created by Oracle whenever an SQL statement is executed, when there is no explicit cursor for the statement. • Whenever a DML statement (INSERT, UPDATE and DELETE) is issued, an implicit cursor is associated with this statement. • For INSERT operations, the cursor holds the data that needs to be inserted. • For UPDATE and DELETE operations, the cursor identifies the rows that would be affected.
  • 12. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Implicit Cursors • These are created by default when DML statements like, INSERT, UPDATE, and DELETE statements are executed. • The user is not aware of this happening & will not be able to control or process the information. • When an implicit cursor is working, DBMS performs the open, fetches and close automatically
  • 13. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) The following table provides the description of the most used attributes − Attribute Name Description %ISOPEN Returns TRUE if cursor is open, FALSE if cursor is closed. SQL%ISOPEN always returns FALSE. %FOUND Returns TRUE if successful fetch has been executed, FALSE if no row was returned. SQL%FOUND is used to access it. %NOTFOUND Return TRUE if no row was returned, FALSE if successful fetch has been executed. SQL%NOTFOUND is used to access it. %ROWCOUNT Returns the number of rows affected by the query. SQL%ROWCOUNT is used to access it.
  • 14. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Example • The following program will update the table and increase the salary of each customer by 500 and use the SQL%ROWCOUNT attribute to determine the number of rows affected.
  • 15. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Example • DECLARE • total_rows number(2); • BEGIN UPDATE customers SET salary = salary + 500; • IF sql%notfound THEN • dbms_output.put_line('no customers selected'); • ELSIF sql%found THEN • total_rows := sql%rowcount; dbms_output.put_line( total_rows || ' customers selected'); • END IF; • END; /
  • 16. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Result: 6 customers selected PL/SQL procedure successfully completed. Select * from customers; +‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+ | ID | NAME | AGE | ADDRESS | SALARY | +‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+ | 1 | Ramesh | 32 | Ahmedabad | 2500.00 | | 2 | Khilan | 25 | Delhi | 2000.00 | | 3 | kaushik | 23 | Kota | 2500.00 | | 4 | Chaitali | 25 | Mumbai | 7000.00 | | 5 | Hardik | 27 | Bhopal | 9000.00 | | 6 | Komal | 22 | MP | 5000.00 | +‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐+
  • 17. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Explicit Cursors • Explicit cursors are programmer defined cursors for gaining more control over the context area. An explicit cursor should be defined in the declaration section of the PL/SQL Block. It is created on a SELECT Statement which returns more than one row. Working with an explicit cursor involves four steps: – Declaring the cursor for initializing in the memory – Opening the cursor for allocating memory – Fetching the cursor for retrieving data – Closing the cursor to release allocated memory
  • 18. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Explicit Cursor • Declaring the cursor defines the cursor with a name and the associated SELECT statement. • Syntax: CURSOR c_customers IS SELECT id, name, address FROM customers; • Opening the cursor allocates the memory for the cursor and makes it ready for fetching the rows returned by the SQL statement into it. • Syntax: OPEN c_customers; • Fetching the cursor involves accessing one row at a time. • Syntax: FETCH c_customers INTO c_id, c_name, c_addr; • Closing the cursor means releasing the allocated memory. • CLOSE c_customers;
  • 19. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Explicit cursors • Explicit cursors are programmer defined cursors for gaining more control over the context area. • An explicit cursor should be defined in the declaration section of the PL/SQL Block. • It is created on a SELECT Statement which returns more than one row.
  • 20. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) The following table provides the description of the most used attributes − Attribute Name Description %ISOPEN Returns TRUE if cursor is open, FALSE if cursor is closed. CursorName%ISOPEN is used to access it. %FOUND Returns TRUE if successful fetch has been executed, FALSE if no row was returned. CursorName%FOUND is used to access it. %NOTFOUND Return TRUE if no row was returned, FALSE if successful fetch has been executed. CursorName%NOTFOUND is used to access it. %ROWCOUNT Returns the number of rows affected by the query. CursorName%ROWCOUNT is used to access it.
  • 21. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Explicit cursor involves four steps: 1.Declaring the cursor for initializing in the memory 2.Opening the cursor for allocating memory 3.Fetching the cursor for retrieving data 4.Closing the cursor to release allocated memory
  • 22. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) STEPS
  • 23. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Declaring the Cursor Syntax: • CURSOR cursor_name IS select_statement; For example: • CURSOR c_customers IS • SELECT id, name, address FROM customers; Opening the Cursor Syntax: • OPEN cursor_name; Example: • OPEN c_customers;
  • 24. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Fetching the Cursor • Fetching the cursor involves accessing one row at a time. Syntax: • FETCH cursor_name INTO record_name; Example: • FETCH c_customers INTO c_id, c_name, c_addr; Closing the Cursor • Closing the cursor means releasing the allocated memory. Syntax: • CLOSE cursor_name; Example: • CLOSE c_customers;
  • 25. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) EXAMPLE • DECLARE • c_id customers.id%type; • c_name customers.name%type; • c_addr customers.address%type; • CURSOR c_customers IS SELECT id, name, address FROM customers; • BEGIN • OPEN c_customers; • LOOP • FETCH c_customers into c_id, c_name, c_addr; • EXIT WHEN c_customers%notfound; • dbms_output.put_line(c_id || ' ' || c_name || ' ' || c_addr); • END LOOP; • CLOSE c_customers; • END;
  • 26. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) RESULT: 1 Ramesh Ahmedabad 2 Khilan Delhi 3 kaushik Kota 4 Chaitali Mumbai 5 Hardik Bhopal 6 Komal MP PL/SQL procedure successfully completed.
  • 27. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Cursor Attributes • cursorname%ROWCOUNT Rows returned so far • cursorname%FOUND One or more rows retrieved • cursorname%NOTFOUND No rows found • Cursorname%ISOPEN Is the cursor open
  • 28. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Implicit cursor Oracle Tutorials: PL/SQL DECLARE l_rows number(5); BEGIN UPDATE employee SET salary = salary + 1000; IF SQL%NOTFOUND THEN dbms_output.put_line('None of the salaries where updated'); ELSIF SQL%FOUND THEN l_rows := SQL%ROWCOUNT; dbms_output.put_line('Salaries for ' || l_rows || 'employees are updated'); END IF; END;
  • 29. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Using explicit cursors Oracle Tutorials: PL/SQL • Fetching results of a query into RECORD DECLARE l_employees employees%ROWTYPE; CURSOR l_c (p_low NUMBER DEFAULT 0, p_high NUMBER DEFAULT 99) is SELECT * FROM employees WHERE job_id > p_low AND job_id < p_high; BEGIN OPEN l_c(3,20); LOOP FETCH l_c INTO l_employees; EXIT WHEN l_c%NOTFOUND; DBMS_OUTPUT.PUT_LINE(l_employees.last_name || l_employees.job_id ); END LOOP; CLOSE l_c; END;
  • 30. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Advantages • Using Cursor we can perform row by row processing . • We can perform row wise validation or operations on each row. • Allow application to access and move around in a set of data rows, rather then merely retrieve a complete result set.
  • 31. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Disadvantages • Uses more resources • Speed and performance issues. • Increased network roundtrip.
  • 32. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) Answers:1.d, 2.b 33 HOME WORK 1 ____ are declared and manipulated in the PL/SQL block code for handling a set of rows returned by a SELECT statement. a. Explicit cursors b. Dynamic cursors c. static cursors d. Implicit cursors 2. The ____ action used with an explicit cursor creates a named cursor identified by a SELECT statement. a. OPEN b. DECLARE c. FETCH d. CLOSE
  • 33. University Institute of Engineering (UIE) Department of Computer Science and Engineering (CSE) References Other References • PL/SQL - Cursors - Tutorialspoint • PL/SQL Cursor - javatpoint • PL/SQL Cursor (plsqltutorial.com) • Suggested Book References • C.J.Date, “An Introduction to DatabaseSystems”, Addison Wesley. • Thomas M. Connolly, Carolyn & E.Begg,“Database Systems: A Practical Approach to Design, Implementationand Management”, 5/E, University of Paisley, Addison-Wesley. • Rob,”Database Principal Fundamental Design, Cengage Learning. •