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

explain about index with examples

2 Answers   Syntel,


What is a composite index and how does it differ from a multiple index?

1 Answers  


Where could you look if you had a question about whether a column has been defined as an index?

2 Answers  


What is the use of COMMAREA ?Minimum how much data we can pass from it?

7 Answers   Cap Gemini,


How is a typical DB2 batch program executed ?

1 Answers  






What is the difference between base table and view?

7 Answers  


How to rename a table in DB2 ?

0 Answers   MCN Solutions,


How does db2 sample database connect?

0 Answers  


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

3 Answers   IBM,


is there any restrictions for unions ?

4 Answers   Patni,


How can you get the number of rows impacted by the last executed query?

1 Answers  


How to connect to db2 database from windows command line?

0 Answers  


Categories