wht happens if we close cursor with cursor with hold option?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What are common abends
What is the meaning of -805 SQL return code?
What is dynamic SQL?
Is it mandatory to use DCLGEN? If not, why would you use it at all?
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?
Give some example of statistics collected during RUNSTATS?
What is QUIESCE?
wt is view ? wht r the restrictions for view ?
What does db2 stand for?
What language is db2 written in?
what is the Foreign key? explain?
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.