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

what are the bind parameters?

5 Answers   IBM,


Is it possible to precompile if db2 goes down?

4 Answers   Target,


What is a lock?

1 Answers  


In cobol+DB2program if the code of cobol program has changed than i have to do precompilation once again?

6 Answers   TCS,


What is an asychronous write?

1 Answers  






could you give me an example how, where i code CHECKPOINT and restart...I need and example....thanks..

5 Answers  


List down the types of triggers in the db2 database?

0 Answers  


what is datacom db?

2 Answers   CSC,


What is Skeleton cursor table (SKCT)?

2 Answers  


What is IMAGECOPY ?

6 Answers  


How is a typical db2 batch pgm executed?

0 Answers  


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?

1 Answers  


Categories