
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Declare NOT FOUND Handler in MySQL Cursor
We must have to declare NOT FOUND handler while working with MySQL cursor because it handles the situation when cursor could not find any row. It also handles the situation when the cursor reaches the end of the row because every time we call FETCH statement the cursor finds to attempt the next row in the result set. Following is the syntax to declare NOT FOUND handler −
DECLARE CONTINUE HANDLER FOR NOT FOUND SET var_name = value;
Here var_name is the name of any variable and value would be the value of that variable. For example, we can declare it as follows −
DECLARE CONTINUE HANDLER FOR NOT FOUND SET err = 1;
Advertisements