There are two types of cursors present in PL/SQL:-
Implicit Cursors:-
Explicit Cursors:-
Implicit Cursors:-
- Automatically created whenever a SQL statement (DML) is executed.
- For SELECT statement this implicit cursor consists of rows that will be retrieved.
- For INSERT -->it will be the rows that are going to be inserted
- For UPDATE--> it will be the rows that are going to be affected
- For DELETE--> it will be the rows that will be deleted
- You can find if any row is affected or not and how many rows are affected by using SQL%ATTRIBUTES.
Explicit Cursors:-
- Explicit cursors are explicitly declared in the PL/SQL declare section
- You can access this cursor in the PL/SQL code using cursor name
- Explicit cursors can be defined only for the select statements
- You can find if any row is affected or not and how many rows are affected by using <cursor_name>%ATTRIBUTES
No comments:
Post a Comment