V$RESERVED_WORDS

List of reserved words - these words should not be used for object or variable names you create or passwords you set.

Columns
   ___________________________
 
   KEYWORD
   LENGTH
   RESERVED
   RES_TYPE   (Y/N Oracle 10g or above)
   RES_ATTR   (Y/N Oracle 10g or above)
   RES_SEMI   (Y/N Oracle 10g or above)
   DUPLICATE  (Y/N Oracle 10g or above)

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:


© Copyright SS64.com 1999-2013
Some rights reserved