wht happens if we close cursor with cursor with hold option?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dbrm in db2 database?

666


What is a db2 table?

685


Name the lockable units in DB2?

759


How do I start db2 in windows?

658


File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?

2505






Why cursor is used in db2?

669


What is a trigger in the db2 database?

670


DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?

2383


What is a collection in db2?

675


How can you quickly find out the # of rows updated after an update statement?

706


What is a db2 cursor?

714


What is db2 purescale?

646


How can record locking be achieved in those DB2 versions which do not support it?

722


What do you mean by rollback?

651


What is temporal table in db2?

692