- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to fetch data from an unopened cursor or opening an already opened cursor?
When we try to fetch the data from the CURSOR which is not open the query will fail. In this case the SQLCODE field of SQLCA will be populated with the DB2 error code - 501. As per the IBM documentation -501 error code states that−
“THE CURSOR IDENTIFIED IN A FETCH OR CLOSE STATEMENT IS NOT OPEN”
When we try to OPEN the cursor which is already open then the query will fail and we will get the error code as -502 in the SQLCODE field of SQLCA. As per the IBM documentation -502 error code states that−
“THE CURSOR IDENTIFIED IN AN OPEN STATEMENT IS ALREADY OPEN”
Advertisements