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

What are common abends

1 Answers   SPIC, Virtusa,


What is the meaning of -805 SQL return code?

3 Answers  


What is dynamic SQL?

1 Answers   ADP,


Is it mandatory to use DCLGEN? If not, why would you use it at all?

2 Answers  


COBOL PRECOMPILER ERROR: "XXXXXX" (TABLE) PREVIOUSLY DECLARED OR REFERENCED DCLGEN VARIABLES GETS IMPORTED TWICE FOR ONLY ONE EXEC SQL STATEMENT. WHAT COULD BE THE PROBLEM?

1 Answers  






Give some example of statistics collected during RUNSTATS?

1 Answers  


What is QUIESCE?

2 Answers  


wt is view ? wht r the restrictions for view ?

3 Answers   Verizon,


What does db2 stand for?

0 Answers  


What language is db2 written in?

0 Answers  


what is the Foreign key? explain?

2 Answers  


What if we try to insert the base table through updatable view , but failed to give a column value which is defined as NOT NULL.

1 Answers   Cap Gemini,


Categories