Cursors in PL/SQL part one

We begin to explain PL/SQL cursors. We’ll look at explicit cursors, their attributes, and coupling variables.

In these we have seen the fundamentals of the PL/SQL language, well, from now on we will study the use of this language to work with the Oracle manager. We will start with the use of cursors.

So far we have used , when we returned the result of a select via the into clause to a variable. But this is a problem when the result of a subquery returned several rows, because this would give us an error when executing the query.

So that we do not get an error in these cases we must use explicit cursors.

explicit cursors

Explicit cursors are used when we have queries that return more than one row.

We have 4 basic operations to work with an explicit cursor.

  1. Cursor declaration: we have to declare it in the declaration area, with the following format:


    CURSOR IS

Categories