![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
Found 4219 Articles for MySQLi
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
455 Views
Following is a stored procedure which fetches the records from name column of table ‘student_info’ having the following data −mysql> Select * from Student_info; +-----+---------+------------+------------+ | id | Name | Address | Subject | +-----+---------+------------+------------+ | 101 | YashPal | Amritsar | History | | 105 | Gaurav | Chandigarh | Literature | | 125 | Raman | Shimla | Computers | | 127 | Ram | Jhansi | Computers | +-----+---------+------------+------------+ 4 rows in set (0.00 sec) mysql> Delimiter // mysql> CREATE PROCEDURE cursor_defined(OUT val ... Read More
![Paul Richard](https://www.tutorialspoint.com/assets/profiles/13505/profile/60_52698-1512536733.jpg)
104 Views
As we know that CONCAT() function returns NULL if any of the arguments is NULL but CONCAT_WS() function returns NULL only if the first argument i.e. the separator is NULL and it ignores any other NULL. We can say this is the advantage of CONCAT_WS() function over CONCAT() function when we want to concatenate the values from the column and any of the columns have NULL as its value. To understand it, we consider the example from the table ‘Student_name; which have the following data −mysql> Select * from Student_Name; +---------+-------+---------+ | FName | Mname | Lname | ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
460 Views
MySQL FORMAT() function, converts a number to a format like #, ###, ###.### which is rounded up to the number of decimal places specified and returns the result as a string, can be used to retrieve the output having decimal values of a column in a specified format. To understand it, we are taking an example of table ‘estimated_cost’ which have the following data −mysql> Select * from estimated_cost; +----+-----------------+-----------+---------------+ | Id | Name_Company | Tender_id | Tender_value | +----+-----------------+-----------+---------------+ | 1 | ABC Ltd. | 110 | 256.3256879 | | 2 ... Read More
![varun](https://www.tutorialspoint.com/assets/profiles/13559/profile/60_29674-1512637943.jpg)
1K+ Views
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 ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
247 Views
The above-said property is not useful especially in the case when we want to concatenate the values from the column and any of the columns have NULL as its value. To overcome this, we can use IFNULL() function along with CONCAT() function. To understand it, we consider the example from the table ‘Student_name; which have the following data −mysql> Select * from Student_Name; +---------+-------+---------+ | FName | Mname | Lname | +---------+-------+---------+ | Rahul | NULL | Singh | | Gaurav | Kumar | NULL | | Harshit | NULL | Khurana | | Yash ... Read More
![Moumita](https://www.tutorialspoint.com/assets/profiles/13507/profile/60_122499-1557898491.jpg)
71 Views
Actually, CONCAT_WS() function returns NULL if and only if the first argument of it i.e. the separator is NULL. An example is as below −mysql> Select CONCAT_ws(NULL, 'Tutorial', 'Point', '.com'); +-------------------------------------------+ | CONCAT_ws(NULL, 'Tutorial', 'Point', '.com') | +-------------------------------------------+ | NULL | +-------------------------------------------+ 1 row in set (0.00 sec)Otherwise, MySQL CONCAT_WS() function ignores NULL if we place NULL at any other position in CONCAT_WS() function while linking the strings. Following examples will exhibit it −mysql> Select CONCAT_ws('s', 'Tutorial', 'Point', '.com', NULL); +-----------------------------------------------+ | ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
158 Views
String-valued functions return NULL if the length of the result would be greater than the value of the max_allowed_packet system variable. Actually, max_allowed_packet is a dynamic global variable which can accept the integer type values. These values can be set for a session only. It can accept 1024 as the minimum value and 1073741824 as the maximum value. The by the default value of this system variable is 1048576.
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
52 Views
MySQL CONCAT() function will return a NULL if you will add a NULL value while linking two strings. Following example will demonstrate it −Examplemysql> Select CONCAT('Tutorials',NULL,'Point'); +----------------------------------+ | CONCAT('Tutorials',NULL,'Point') | +----------------------------------+ | NULL | +----------------------------------+ 1 row in set (0.06 sec) mysql> Select CONCAT('TutorialsPoint','.com',NULL); +--------------------------------------+ | CONCAT('TutorialsPoint','.com',NULL) | +--------------------------------------+ | NULL | +--------------------------------------+ 1 row in set (0.00 sec)
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
73 Views
As we know that MySQL NULLIF() control flow function will return NULL if both the arguments are the same, otherwise it returns the first argument. Hence it is similar to the following CASE statement −CASE WHEN expression1=expression2 THEN NULL ELSE Expression2 END.
![Akshaya Akki](https://www.tutorialspoint.com/assets/profiles/13526/profile/60_48621-1512703980.jpg)
75 Views
As we know that MySQL NULLIF() control flow function will return the first argument both the arguments are not the same. The first argument is returned because MySQL evaluates the first argument twice if both of the arguments are not the same.Examplemysql> Select NULLIF('Tutorialspoint','MySQL'); +----------------------------------+ | NULLIF('Tutorialspoint','MySQL') | +----------------------------------+ | Tutorialspoint | +----------------------------------+ 1 row in set (0.00 sec)In the above example, as the arguments are not the same hence MySQL evaluates the first argument i.e.’Tutorialspoint’ two times and return it as output.