Oracle SQL,PL/SQL

What is a cursor in PL/SQL?

Written by shohal

Cursor:

Cursor is a memory variable, it take space with in row and column.it also can take matrix data.

Also ,A cursor is a pointer that points to a result of a query.

PL/SQL has two types of cursors:

•Implicit cursors

•Explicit cursors

Implicit Cursors

Whenever Oracle executes an SQL statement such as Select Into , Insert , Update  and Delete it automatically creates an implicit cursor.

Implicit Cursors Example:

Here employee_id,first_name insert into the variable v_emp,v_name. This is a select into implicit cursor example.

Explicit cursors

An explicit cursor is an Select statement declared explicitly in the declaration section of the current block or a package specification.

Explicit cursors Example:

Here select statement work within cursor c_emp. Open cursor then fetch insert into the variable and close the c_emp.

Cursor with parameters:

Example:

PLSQL Records and Cursor:

Difference between records and cursor is : Cursor take data from direct table where records take data from cursor.

*Here r_emp is record.

Cursor FOR Loops:

Example:

*for loop : for r_emp in c_emp loop.

About the author

shohal

I have profession and personal attachment with custom ERP Software development, Business Analysis, Project Management and Implementation almost (36) ,also Oracle Apex is my all-time favorite platform to developed the software. Moreover i have some website development experience with WordPress. For hand on networking experience DevOps and CCNA, it create me a full package. Here are some core programming language with networking course i have been worked: Oracle SQL ,PL/SQL,Oracle 19c Database , Oracle Apex 20.1,WordPress,Asp.Net ,MS SQL ,CCNA ,Dev Ops, SAP SD

Leave a Comment