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 is a DB2 bind?
What is explain plan in db2?
What is meant by the attachment facility?
How to fetch the uncommited data from table ?
How to see the structure of db2 table??
What is a recovery log?
query to just fetch first matching row and stop execution. once one matching row is found ..no more records should be checked.. if the first record is matching.. the query must stop
What is a DB2 catalog?
How can you compare table column after update and before update?
What is a collection in db2?
Mention some fields that are a part of sqlca.
What does the sqlcode of -818 pertain to?