cursor with hold explain ?



cursor with hold explain ?..

Answer / ratheesh nellikkal

Hi All,
Cursor is nothing but a pointer to a result set that you
get as a result of executing a query.
So if u wanna some operations using this cursor then u have
to
1. Declare a cursor
2.Open the cursot before the first access
3.Do the operations
4.Close the cursor.

But in case of a normal cursor (not declared with 'with
hold' option) in between the operations if u issued a
commit command then the cursor will be getting closed and
if u wanna access it again then u should open it again.

But incase of a 'With hold' cursor it will maintane the
states if you issed a commit also.
Means it will not get closed by applying frequent commit.

Regards,
Ratheesh Nellikkal

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More DB2 Interview Questions

what is the use of cursors?

3 Answers   iGate,


How to resolve -407 sql code in DB2?

9 Answers   Cap Gemini,


In SPUFI suppose you want to select maximum of 1000 rows, but the select returns only 200 rows. What are the 2 SQLCODEs that are returned?

1 Answers  


what is the differences between spufi and qmf and which is better?

4 Answers   Accenture, Cap Gemini,


What is meant by repeatable read?

4 Answers  


What does a deadlock mean in DB2?

0 Answers  


What is isolation level?

4 Answers  


Say CUST Table contains records like: CUSTNO CUSTNAME CUSTLOC 100 ABC SSS 200 XYZ 300 PQR 400 MNO WWW 500 CVV ------------- ------------- Now write a query to retrieve all records with CUSTLOC no data.

3 Answers   IBM,


What is the difference between static and dynamic SQL?

1 Answers  


Normalization in DB2 – first normal form, second normal form

4 Answers   Virtusa,


How to execute stored procedure in db2 command editor?

0 Answers  


Can you tell me how can you find out the # of rows updated after an update statement?

0 Answers  


Categories