QUOTE_IDENTIFIER

You are viewing an old version of this article. View the current version here.

Syntax

SYS.QUOTE_IDENTIFIER(str)

Description

Quotes a string to produce a result that can be used as an identifier in an SQL statement. The string is returned enclosed by backticks ("`") and with each instance of backtick ("`") doubled. If the argument is NULL, the return value is the word "NULL" without enclosing backticks.

Examples

SELECT SYS.QUOTE_IDENTIFIER("Identifier with spaces");
+------------------------------------------------+
| SYS.QUOTE_IDENTIFIER("Identifier with spaces") |
+------------------------------------------------+
| `Identifier with spaces`                       |
+------------------------------------------------+

SELECT SYS.QUOTE_IDENTIFIER("Identifier` containing `backticks");
+-----------------------------------------------------------+
| SYS.QUOTE_IDENTIFIER("Identifier` containing `backticks") |
+-----------------------------------------------------------+
| `Identifier`` containing ``backticks`                     |
+-----------------------------------------------------------+

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.