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 |
explain about index with examples
What is a composite index and how does it differ from a multiple index?
Where could you look if you had a question about whether a column has been defined as an index?
What is the use of COMMAREA ?Minimum how much data we can pass from it?
How is a typical DB2 batch program executed ?
What is the difference between base table and view?
How to rename a table in DB2 ?
How does db2 sample database connect?
when i am trying to update a table having 1000 rows. the program abends.how we will come to know the last successful updated row was. we are not using any commit operations
is there any restrictions for unions ?
How can you get the number of rows impacted by the last executed query?
How to connect to db2 database from windows command line?