What are cursors? Name four types of cursors and when each
one would be applied?

Answer Posted / khushboo rastogi

A cursor is a temporary work area created in the system memory when a SQL statement
is executed. A cursor contains information on a select statement and the rows of data
accessed by it. This temporary work area is used to store the data retrieved from the
database, and manipulate this data. A cursor can hold more than one row, but can process
only one row at a time. The set of rows the cursor holds is called the active set.

There are two types of cursors in PL/SQL:

Implicit cursors:

These are created by default when DML statements like, INSERT, UPDATE, and
DELETE statements are executed. They are also created when a SELECT statement that
returns just one row is executed.

Explicit cursors:

They must be created when you are executing a SELECT statement that returns more
than one row. Even though the cursor stores multiple records, only one record can be
processed at a time, which is called as current row. When you fetch a row the current row
position moves to next row.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the library index called?

670


What is sql server database?

577


What is difference between count (*) and count 1?

584


How do I clean up sql server transaction log?

637


How can a database be repaired?

645






you added a row to a view, but the row is not shown on the view. Explain how this can happen, and how you can remedy the situation

610


Write SQL queries on Self Join and Inner Join.

709


Explain the architecture of ms sql reporting service?

605


What is the use of builtinadministrators group in sql server? : sql server security

619


What are the types of database recovery models?

671


What do you understand by integration services in sql server?

638


What are the different type of replication in sql server?

632


Can I disable or restrict ssrs export formats (rendering formats)?

116


What are system databases into sql server (2005/2008)?

663


How many null values we can have in a unique key field in sql server?

635