Note
This view is available starting with V4.4.2 BP3.
Purpose
The V$OB_KEYWORDS view displays the keywords supported by OceanBase Database.
Columns
Column |
Type |
Nullable? |
Description |
|---|---|---|---|
| KEYWORD | varchar(128) | NO | Keyword name |
| LENGTH | bigint(20) | NO | Length of the keyword |
| TYPE | varchar(16) | NO | Keyword type. The current value can only be SQL or PL |
| RESERVED | bigint(20) | NO | Indicates whether it is a reserved keyword |
Considerations
You can use this view to check whether a string can be used as an identifier. However, in the current implementation of OceanBase Database, a small number of non-reserved keywords cannot actually be used as identifiers.
The following non-reserved keywords cannot be used as identifiers in MySQL-compatible mode:
Notice
These keywords are not prohibited in all cases. For example, some of them cannot be used as table aliases but can be used as column names. We recommend that you avoid these keywords in scenarios where identifiers are required, such as when you create objects, table names, or column names.
EXCEPTINTERSECTMINUSMEMBERSOUNDSWINDOW
Sample query
obclient > SELECT * FROM oceanbase.V$OB_KEYWORDS LIMIT 5;
The query result is as follows:
+------------+--------+------+----------+
| KEYWORD | LENGTH | TYPE | RESERVED |
+------------+--------+------+----------+
| accessible | 10 | SQL | 1 |
| add | 3 | SQL | 1 |
| all | 3 | SQL | 1 |
| alter | 5 | SQL | 1 |
| analyze | 7 | SQL | 1 |
+------------+--------+------+----------+