Define Simple/Explicit , Parametric and Internal/Implicit cursor.
- A Cursor is a PL/SQL construct and accesses the stored information in a named work area.
There are 2 types of cursors:1. Implicit cursor:- PL/SQL creates an implicit cursor whenever an SQL statement is executed through the code, unless the code employs an explicit cursor.
- The developer does not explicitly declare the cursor, thus, known as implicit cursor.
Example:In the following UPDATE statement, which gives everyone in the company a 20% raise, PL/SQL creates an implicit cursor to identify the set of rows in the table which would be affected.
UPDATE emp
SET salary = salary * 1.2;
2. Explicit cursor:- It can be declared by us for the queries that return more than one row.
- The cursor names here are the unnamed work area in which the database stores processing information when it executes a multiple-row query.
- When you have named the work area, you can access its information, and process the rows of the query individually.