wht happens if we close cursor with cursor with hold option?

Answers were Sorted based on User's Feedback



wht happens if we close cursor with cursor with hold option?..

Answer / ratheesh nellikkal

Once u issued a close cursor statement , it will get closed.
You can not access it after that until u open it again.
In that case your procedure will exit with an error message
like
"SQL0501N The cursor specified in a FETCH or CLOSE
statement is not open. SQLSTATE=24501"

With hold option doesn't make any difference in this case.


But if you are doing a commint operation in between your
transactions then a cursor declared with 'with hold' option
will not get closed.

Is This Answer Correct ?    23 Yes 2 No

wht happens if we close cursor with cursor with hold option?..

Answer / rohit mishra

Once u issued a close cursor statement , it will get closed.
You can not access it after that until u open it again.
In that case your procedure will exit with an error message
like
"SQL0501N The cursor specified in a FETCH or CLOSE
statement is not open. SQLSTATE=24501"

With hold option doesn't make any difference in this case.


But if you are doing a commint operation in between your
transactions then a cursor declared with 'with hold' option
will not get closed.

Is This Answer Correct ?    7 Yes 2 No

wht happens if we close cursor with cursor with hold option?..

Answer / yuvaevergreen

A held cursor can be closed when
1.CLOSE cursor is issued.
2.ROLLBACK is issued.
3.Application terminates.

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More DB2 Interview Questions

How can you count the number of rows from a table tab?

0 Answers  


What is query_cache_limit?

0 Answers  


Can you define an Index if the table size less than 10 PAGES?

1 Answers   IBM,


Hello All, We have requirment to Replace BMC Db2 Load product thru CA FAST LOADPlus product. Do anyone have JCL to for FAST LOADPLUS and what all are thing need to take in consideration.

0 Answers   IBM,


What is the use of DELGEN in DB2? Can we Write the program with out using it?

6 Answers   Cap Gemini,






why we create view.

5 Answers  


What is dbrm?

0 Answers  


Is it Possible to read from PS file and write it to database by using dynamic sql(execute immediate)

2 Answers  


if any of the column names is provided wrong, where do you get the error(during precompilation or during Bind)

3 Answers  


What does DSNDB07 database do?

2 Answers  


What can the SET option of the Repair Utility accomplish?

1 Answers  


When is the authorization check on DB2 objects done - at BIND time or run time?

1 Answers  


Categories