What will happen if an error occurs during:
- Declaring a cursor
- Fetching data
What will happen if the error occurs before the cursor is closed? Does it close automatically?
When I use a cursor, what is the best practice for handling errors?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When an error occurs after declaring the cursor and the batch terminates, the cursor will remain open. The cursor will be closed after the connection is closed.
If you can capture the error, it is good practice to close the cursor as part of the error handling.