a cursor normally gets closed once we provide a commit . If
u try to close the same cursor with close cursor command
later after providing the commit will there be any sql-error.

Answers were Sorted based on User's Feedback



a cursor normally gets closed once we provide a commit . If u try to close the same cursor with cl..

Answer / pavithra

when we try to close the cursor that is already closed, it
will return the SQL error code

-501 - cursor found in the fetch or close statement is not open.


please correct me if wrong

Is This Answer Correct ?    4 Yes 3 No

a cursor normally gets closed once we provide a commit . If u try to close the same cursor with cl..

Answer / manasa

WHEN THE CURSOR IDENTIFIED IN A FETCH OR CLOSE STATEMENT IS
NOT OPEN,then we get -501 error.

Is This Answer Correct ?    1 Yes 0 No

a cursor normally gets closed once we provide a commit . If u try to close the same cursor with cl..

Answer / mehdee

- If you do COMMIT in your program, that means you have
UPDATE, INSERT or DELETE, which in this case you must
DECLARE CURSOR WITH HOLD, then it will not be closed after
COMMIT.

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More DB2 Interview Questions

what is the use of cursors?

3 Answers   iGate,


in column y record abc.v abc.s xyz.j abc.h i wan only abc columns how to retrieve thi records

2 Answers   IBM,


What is the clustering index in the db2 database?

0 Answers  


Are view updateable?

0 Answers  


How do you declare a host variable (in COBOL) for an attribute named emp-name of type VARCHAR(25) ?

2 Answers   IBM, Tech Mahindra,






What techniques will be used to avoid deadlock??

5 Answers   IBM, SUN,


Suppose we are doing transaction in a table and abend happened in between. Suppose i have completed the transaction upto X rows and I want to start the transaction again where the abend happened. I don't want to do the transaction from the first record. Then what i have to do.

9 Answers   Cap Gemini,


What is a SELECT statement?

1 Answers  


What does the RUNSTATS Utility do?

4 Answers  


What is concurrency?

0 Answers  


What is the difference between spufi and qmf?

0 Answers  


Can we declare cursor in Procudere division or open the cursor in the Working storage section. Is there any particular rules in the usage of cursors lifecycle

1 Answers   Infosys,


Categories