7 / 31
What is Cursor and How many types of Cursor you have used?
Cursors help us to do an operation on a set of data that we retrieve by commands such as Select columns from a table. For example : If we have duplicate records in a table we can remove it by declaring a cursor which would check the records during retrieval.
There are mainly 2 types of cursors .
1) Implicit Cursor.
2) Explicit Cursor.
Implicit Cursor: Oracle will implicitly creates an area for the DML operations. Programmer will not have control on implicit cursors. The only useful attribute on this implicit cursor is SQL%ROWCOUNT , it will give the number of rows affected by the recent DML operation.
Explicit Cursor: created by the programmer and programmer have control on it Programmer can
1) Open 2) Close 3) Fetch
one by one and remove rows which have duplicate values.
Explicit Cursors are classified into
1) Normal cursor
2) Parameterized cursor
3) Cursor For Loops and
4) REF cursors
Asked In ::
Swati Verma
23 Feb, 2019 5:07 AM
There are mainly 2 types of cursors .
1) Implicit Cursor.
2) Explicit Cursor.
Implicit Cursor: Oracle will implicitly creates an area for the DML operations. Programmer will not have control on implicit cursors. The only useful attribute on this implicit cursor is SQL%ROWCOUNT , it will give the number of rows affected by the recent DML operation.
Explicit Cursor: created by the programmer and programmer have control on it Programmer can
1) Open 2) Close 3) Fetch
one by one and remove rows which have duplicate values.
Explicit Cursors are classified into
1) Normal cursor
2) Parameterized cursor
3) Cursor For Loops and
4) REF cursors