[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Technical Discussion :: Oracle PLSQL

2. What is Cursor and How many types of Cursor you have used?

Answer:

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 :: Syntel Inc.

Post Your Answer Here:

Name *
Email
Alert me

Post Your Reply Here:

Report Error

Please Login First Click Here