What is the use of cursor ? how cursor allocate context area for executing the sql statement?

Answers were Sorted based on User's Feedback



What is the use of cursor ? how cursor allocate context area for executing the sql statement?..

Answer / sowmya

Hi
cursors allow row -by-row processing of the resultsets
Types of cursors are: static,dynamic,
forward-only,keyset-driven,

disadvantages of cursors are : each time you fetch a row
from the cursor,it results in a network roundtrip,where are
as normal select query makes only one round trip
cursors are costly as they need temparory storage.

Is This Answer Correct ?    5 Yes 0 No

What is the use of cursor ? how cursor allocate context area for executing the sql statement?..

Answer / kamal

Cursor is a named private SQL area from where information
can be accessed. Cursors are required to process rows
individually for queries returning multiple rows.


Within the library cache, parsed SQL is stored as cursors.
The cursors are indexed by handlers referencing memory
locations within which parsed statements and information
relating to processing are stored. A context area is a
shared area of memory that stores the environment and
session variables for an instruction. Buffer caches store
active data and use a cache replacement scheme storing the
most recently used data.

Is This Answer Correct ?    1 Yes 0 No

What is the use of cursor ? how cursor allocate context area for executing the sql statement?..

Answer / anil kumar jaiswal

cursor :

Oracle create a memory area called context area to execute sql statements. that context area keep all information about the statement processed.
cursor is just a pointer to that context area and you can also say a cursor is pointing to result set of a query.
Types cursor :
1.Implicit cursor : implicit cursor automatically created by oracle when ever there is dml operation performed inside pl/sql block.(dml operation means insert,update,delete).
2. Explicit Cursor : its a user defined cursor, user need to define it explicitly.
cursor declared in declaration section called explicit cursor.

Cursor Attributes : there is 4 types of cursor attributes used.
1.%notfound.
2.%found.
3.%isopen
4.%rowcount.
for more queries contact me on aniljaiswal143@gmail.com.

Is This Answer Correct ?    1 Yes 0 No

What is the use of cursor ? how cursor allocate context area for executing the sql statement?..

Answer / ragaventhar

Cursor is used to fetch the data from a main table to temporary variable at run time and it is affected row by row .Mainly used to stored a data temporary and give the result set at the time of run time

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What are different types of statements supported by sql?

0 Answers  


Does truncate release storage space?

0 Answers  


What is the usage of nvl function?

0 Answers  


how to get @@error and @@rowcount at the same time? : Sql dba

0 Answers  


Why functions are used in sql?

0 Answers  


How to get the 3rd column(i.e all the data along with the column name)in a table?

2 Answers   Logica CMG,


ename empno deptno amar 1 10 akbar 2 20 anthonny 3 30 jonathan 4 40 write a procedure to dispaly the column values ina row separated by a deleimiter eg - input - select ename from emp '|' output - amar|akbar|anthony|jonathan input - select empno from emp '@' o/p - 1@2@3@4 input - select deptno from emp '/' o/p - 10/20/30/40 Pls answer this questn.

2 Answers  


What is cost in sql execution plan?

0 Answers  


What are user defined stored procedures ?

3 Answers   BirlaSoft,


Can pl sql procedure have a return statement?

0 Answers  


Which is better trigger or stored procedure?

0 Answers  


what are the advantages of sql ? : Sql dba

0 Answers  


Categories