Home Oracle Commands v$ Performance views
Oracle Data Dictionary

V$RESERVED_WORDS

Data Dictionary View

Columns
   ___________________________
 
   KEYWORD
   LENGTH

Examples

-- Find a keyword:

select keyword
from V$RESERVED_WORDS
where keyword ='pctincrease';

-- Examples of reserved words/keywords that throw an error:

SQL> create table user(test varchar2(10));
create table user(test varchar2(10))
*
ERROR at line 1:
ORA-00903: invalid table name

SQL> create table test(user varchar2(10));
create table test(user varchar2(10))
*
ERROR at line 1:
ORA-00904: : invalid identifier

-- Examples of reserved words/keywords that don't throw an error :
-- (these can still cause problems)

SQL> create table type(sid varchar2(3), id varchar2(3), data varchar2(3));

Table created.


-- Find any tables, views etc with reserved words:

SQL> select object_name,object_type,owner,keyword
from dba_OBJECTS,v$reserved_words
where object_name=keyword
and owner = 'MY_SCHEMA';

Table created.

-- Find columns in any table with reserved words:

select
table_name,column_name,owner,keyword
from dba_TAB_COLUMNS,v$reserved_words
where column_name=keyword
and owner = 'MY_SCHEMA';

If you run the two scripts above against the SYS schema you will find many system views and tables which contain reserved words and keywords. This is to be expected - they are 'reserved' for use by Oracle.

In addition to reserved words, Oracle implicitly generates system names beginning with "SYS_" Oracle discourages you from using this prefix.

Related:



Simon Sheppard
SS64.com