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

How do I delete a table in database?

1 Answers  


how to u check the query is executing or not ?where will u check for sqlcode ?

6 Answers   Infosys,


What is a recovery log?

1 Answers  


can any body explain about plan and pakage in detail....

2 Answers   HSBC, IBM,


Highlight all the advantages that are attached to a package.

1 Answers  


What are foreign keys in db2?

1 Answers  


What is query for your birthday date should be in hours,minute and seconds format?

1 Answers   Fidelity,


What technique is used to retrieve data from more than one table in a single SQL statement?

9 Answers   CTS, IBM, TCS,


Which isolation level provides highest data integrity?

1 Answers  


database DSNDB01 means a.db2 catalog b.db2 directory c.BSDS d.active logs answer with reason please

1 Answers  


Which DB2 catalog tables are used to produce a list of table column by table for all tables in a database?

1 Answers  


What are the bind parameters ibm db2?

1 Answers  


Categories