Note
This view is available starting with V5.0.1.
Overview
This view is used to provide external keyword query capabilities.
Columns
Column |
Type |
Is NULL |
Description |
|---|---|---|---|
| KEYWORD | VARCHAR2(128) | NO | Keyword name |
| LENGTH | NUMBER | NO | Length of keywords |
| TYPE | VARCHAR2(16) | NO | Keyword type. The current value can only beSQLorPL |
| RESERVED | NUMBER(38) | NO | Whether it is a reserved keyword. |
Usage instructions
This view may be used 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 an Oracle-compatible tenant:
Notice
These keywords are not universally prohibited. For example, some cannot be used as table aliases but can be used as column names. It is recommended that you avoid using these keywords when creating objects, table names, or column names where identifiers are required.
In Oracle-compatible tenant SQL mode:
USINGBULKCOLLATECROSSFULLINNERJOINLOGLEFTNATURALRETURNRIGHTRETURNING
In Oracle-compatible tenant PL mode:
CHARACTERCONSTANTDATEFLOATLOOPNUMBERRAWREALVARCHARVARCHAR2
Sample query
obclient > SELECT * FROM sys.V$OB_KEYWORDS where TYPE = 'PL' and rownum <= 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 |
+------------+--------+------+----------+
