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

Query to get the Concurrent Program along with Value Set details

SELECT fcpl1.user_concurrent_program_name       ,fdfcuv.end_user_column_name       ,ffvs.flex_value_set_name value_set_name       ,ffvt.appl...