Monday, November 5, 2018

Cursors in Oracle

There are two types of cursors present in PL/SQL:-

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

SupplierAddressImportTemplate.xlsm South Africa Suburb Field mapping in POZ_SUPPLIER_ADDRESSES_INT

Suburb mpping in Supplier Address Import Template will be mapped to Address Element Attribute2 (HZ_LOCATIONS. ADDR_ELEMENT_ATTRIBUTE2)