information_schema.KEYWORDS is used to enumerate all SQL keywords recognized by the current instance through SQL queries and to identify which of them are reserved words. This view is commonly used in the following scenarios:Field Name | Type | Description |
WORD | VARCHAR(128) | The keyword itself is returned in uppercase, for example, SELECT, ADD, ACCOUNT. |
RESERVED | INT | Whether it is a reserved word. 1 indicates a reserved word, which must be enclosed in backticks when the reserved word is used as an identifier.0 indicates a non-reserved word, which can be used directly as an identifier. |
tdsql> SELECT * FROM information_schema.KEYWORDS;+----------------------------------------+----------+| WORD | RESERVED |+----------------------------------------+----------+| ACCESSIBLE | 1 || ACCOUNT | 0 || ACTION | 0 || ADD | 1 || ALL | 1 || ALTER | 1 || ... | ... |+----------------------------------------+----------+
RESERVED field:tdsql> SELECT WORD FROM information_schema.KEYWORDS WHERE RESERVED = 1 ORDER BY WORD;
ORDER) is a reserved word:tdsql> SELECT WORD, RESERVED FROM information_schema.KEYWORDS WHERE WORD = 'ORDER';+-------+----------+| WORD | RESERVED |+-------+----------+| ORDER | 1 |+-------+----------+
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan