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

In BIND, isolation level parameter specifies the duration of page lock and ACQUIRE, RELEASE also do almost the same thing. What is the exact difference between the two? Do they work in conjunction while executing SQL queries and obtaining locks?

8 Answers   Syntel,


When do you specify the isolation level?

0 Answers  


How do you do the EXPLAIN of a dynamic SQL statement?

2 Answers  


Are views updatable ?

4 Answers  


Is db2 relational database?

0 Answers  






I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?

0 Answers  


How to fetch the last row from the table in SQL (db2)?

0 Answers  


what are the copybook changes generally we done?can anyone tell me......... Thanks in advance........

1 Answers  


What is bufferpool in db2?

0 Answers  


How to create db2 table in mainframe?

0 Answers  


What is the difference between base table and view?

7 Answers  


What is the syntax for creating a table in the db2 database?

0 Answers  


Categories