How many types of cursors are available in PL/SQL?

There are two types of cursors in PL/SQL.

  1. Implicit cursor, and
  2. explicit cursor

In PL/SQL, there are two main types of cursors:

  1. Implicit Cursors: These cursors are created by default when DML (Data Manipulation Language) statements like SELECT, INSERT, UPDATE, or DELETE are executed. They are automatically created and managed by the Oracle database engine. You don’t need to explicitly declare or define them.Example of an implicit cursor:
    SELECT column_name INTO variable FROM table_name WHERE condition;
  2. Explicit Cursors: These cursors are explicitly declared and defined by the PL/SQL programmer. They provide more control over the query processing and are explicitly opened, fetched, and closed.Example of an explicit cursor:
    DECLARE
    CURSOR cursor_name IS
    SELECT column_name FROM table_name WHERE condition;
    BEGIN
    OPEN cursor_name;
    FETCH cursor_name INTO variable;
    CLOSE cursor_name;
    END;

So, the correct answer to the question “How many types of cursors are available in PL/SQL?” is two: Implicit Cursors and Explicit Cursors.