a cursor normally gets closed once we provide a commit . If
u try to close the same cursor with close cursor command
later after providing the commit will there be any sql-error.
Answers were Sorted based on User's Feedback
Answer / pavithra
when we try to close the cursor that is already closed, it
will return the SQL error code
-501 - cursor found in the fetch or close statement is not open.
please correct me if wrong
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / manasa
WHEN THE CURSOR IDENTIFIED IN A FETCH OR CLOSE STATEMENT IS
NOT OPEN,then we get -501 error.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / mehdee
- If you do COMMIT in your program, that means you have
UPDATE, INSERT or DELETE, which in this case you must
DECLARE CURSOR WITH HOLD, then it will not be closed after
COMMIT.
| Is This Answer Correct ? | 1 Yes | 2 No |
What is cursor stability in db2?
What is consistency token in db2?
Can there be more than one cursor open for any program?
What is the STOSPACE Utility used for?
What is an asychronous write?
What is a thread?
select * from orders where odate between '2010-01-01'and '2010-03-31' How do u fetch this into cursor?
What is error -818 in db2. where can you find the timestamp of the DBRM and the source code.( precompile puts the timestamp on dbrm and source code correct?)
Mention the definition of cobol in varchar field.
What is rebind in db2?
what's the equivalent Cobol Data type for Decimal(x,y) in DB2? what does the current SQLID register contain?
3 Answers Cap Gemini, Tech Mahindra,
How to fetch the last row from the table in SQL (db2)?