
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What is the use of IGNORE_SPACE SQL mode?
The IGNORE_SPACE SQL mode can be used to modify how the parser treats function names that are whitespace-sensitive. Following are the cases in which we can use IGNORE_SPACE SQL mode −
Case-1 − When IGNORE_SPACE SQL mode is disabled
After disabling the IGNORE_SPACE SQL mode, the parser interprets the name as a function call when there is no whitespace between the name and the following parenthesis. This also occurs when the function name is used in a non-expression context. It can be understood from the following query −
mysql> Create table SUM(Id Int); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM(Id Int)' at line 1
Now we can use either whitespace or write the name in quotes to eliminate the error and cause the name to be treated as an identifier. Following statements did the same −
Create table SUM (id int); Create table ‘SUM’(id int); Create table ‘SUM’ (id int);
Case-2 − When IGNORE_SPACE SQL mode is enabled
When we enable this mode, the parser relaxes the requirement that there be no whitespace between the function name and the following parenthesis. For example, after enabling IGNORE_SPACE SQL mode both of the following function calls are legal −
Select SUM(Salary) from employee; Select SUM (Salary) from employee;
But, in this case, the parser treats the function name as reserved words. It means that a space following the names no longer represents an identifier.
- Related Articles
- What is the use of ALLOW_INVALID_DATES SQL mode?
- What is the use of NO_UNSIGNED_SUBTRACT SQL mode in handling overflow?
- What is the use of MySQL IGNORE INSERT statement?
- What is the use of update command in SQL?
- Mean and Mode in SQL Server
- How does the precedence of || operator depend on PIPES_AS_CONCAT SQL mode?
- Meaning of Activation mode “Activate and ignore the inconsistencies in affected objects” in SAP HANA
- What is the holozoic mode of nutrition?
- What is the chemoautotrophic mode of nutrition?
- What is SQL?
- What is Mode?
- What is the architecture of Asynchronous Transfer Mode?
- What is the mode of nutrition in amoeba?
- What is the mode of nutrition in fungi?
- What is the mode of nutrition in plants?
