- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
Why is it necessary to declare NOT FOUND handler while using MySQL cursor?n
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;
- Related Articles
- Why is it necessary to declare NOT FOUND handler while using MySQL cursor?\n
- In MySQL, how can we declare a handler while handling errors?
- Why is it necessary to do sex?
- Why is it necessary to conserve our environment?
- Why is it necessary to excrete waste products?
- Why it is necessary to balance the chemical equation?
- Why is it advised not to hold the thermometer by its bulb while reading it?
- Is it necessary to add DEFAULT NULL in MySQL?
- What is MySQL NOT NULL constraint and how can we declare a field NOT NULL while creating a table?
- Why a mentor is necessary in life to achieve success?\n
- Why is it necessary to have a girl or boyfriend in life?
- Why it is not advisable to measure length using body parts?
- Why is it bad to watch TV while eating?
- Why reproduction is necessary?
- What is mundan ceremony or mundan sanskar and why is it necessary?
- Using DECLARE to create variable in MySQL?

Advertisements