Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.7Mb
PDF (A4) - 37.7Mb
PDF (RPM) - 37.0Mb
HTML Download (TGZ) - 10.2Mb
HTML Download (Zip) - 10.3Mb
HTML Download (RPM) - 8.9Mb
Man Pages (TGZ) - 214.7Kb
Man Pages (Zip) - 327.7Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  ...  /  The quote_identifier() Function

26.4.5.18 The quote_identifier() Function

Given a string argument, this function produces a quoted identifier suitable for inclusion in SQL statements. This is useful when a value to be used as an identifier is a reserved word or contains backtick (`) characters. It was added in MySQL 5.7.14.

Parameters

in_identifier TEXT: The identifier to quote.

Return Value

A TEXT value.

Example
mysql> SELECT quote_identifier('plain');
+---------------------------+
| quote_identifier('plain') |
+---------------------------+
| `plain`                   |
+---------------------------+
mysql> SELECT quote_identifier('trick`ier');
+-------------------------------+
| quote_identifier('trick`ier') |
+-------------------------------+
| `trick``ier`                  |
+-------------------------------+
mysql> SELECT quote_identifier('integer');
+-----------------------------+
| quote_identifier('integer') |
+-----------------------------+
| `integer`                   |
+-----------------------------+

User Comments
Sign Up Login You must be logged in to post a comment.