Oracle 视图 V$RESERVED_WORDS 官方解释,作用,如何使用详细说明

本站中文解释

Oracle视图V$RESERVED_WORDS是一个系统查看。它包含Oracle数据库中预定义的保留字列表。保留字是一组专为特定编程语言, 例如SQL的特定用途的词语。它们无法作为表名, 列名, 模式名等使用,因为这些词语被作为数据库结构或已经定义好的指令使用。

使用Oracle视图V$RESERVED_WORDS时,可以运行一个SQL查询,查看保留字清单:

select * from v$reserved_words;

另外,也可以使用v$reserved_words视图来检查某个表是否有使用保留字作为名字。下面的查询检查表的名字是否与保留字冲突:

select count(*) from v$reserved_words where lower(word) = ‘table_name’;

官方英文解释

V$RESERVED_WORDS displays a list of all SQL keywords. To determine whether a particular keyword is reserved in any way, check the RESERVED, RES_TYPE, RES_ATTR, and RES_SEMI columns.

Column Datatype Description

KEYWORD

VARCHAR2(128)

Name of the keyword

LENGTH

NUMBER

Length of the keyword

RESERVED

VARCHAR2(1)

Indicates whether the keyword cannot be used as an identifier (Y) or whether the keyword is not reserved (N)

RES_TYPE

VARCHAR2(1)

Indicates whether the keyword cannot be used as a type name (Y) or whether the keyword is not reserved (N)

RES_ATTR

VARCHAR2(1)

Indicates whether the keyword cannot be used as an attribute name (Y) or whether the keyword is not reserved (N)

RES_SEMI

VARCHAR2(1)

Indicates whether the keyword is not allowed as an identifier in certain situations, such as in DML (Y) or whether the keyword is not reserved (N)

DUPLICATE

VARCHAR2(1)

Indicates whether the keyword is a duplicate of another keyword (Y) or whether the keyword is not a duplicate (N)

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data


数据运维技术 » Oracle 视图 V$RESERVED_WORDS 官方解释,作用,如何使用详细说明