Oracle7 Server SQL Reference

Contents Index Home Previous Next

Object Names and Qualifiers

This section tells provides:

Object Naming Rules

The following rules apply when naming objects:

Note: You cannot use special characters from European or Asian character sets in a database name, global database name, or database link names. For example, the umlaut is not allowed.

Reserved words

ACCESS ADD ALL* ALTER AND* ANY* AS* ASC* AUDIT BETWEEN* BY* CHAR* CHECK* CLUSTER COLUMN COMMENT COMPRESS CONNECT CREATE* CURRENT* DATE DECIMAL DEFAULT* DELETE* DESC* DISTINCT* DROP

ELSE EXCLUSIVE EXISTS* FILE FLOAT* FOR* FROM* GRANT* GROUP* HAVING* IDENTIFIED IMMEDIATE IN* INCREMENT INDEX INITIAL INSERT* INTEGER* INTERSECT INTO* IS* LEVEL LIKE* LOCK LONG

MAXEXTENTS MINUS MODE MODIFY NOAUDIT NOCOMPRESS NOT* NOWAIT NULL* NUMBER OF* OFFLINE ON* ONLINE OPTION* OR* ORDER* PCTFREE PRIOR PRIVILEGES* PUBLIC* RAW RENAME RESOURCE REVOKE ROW ROWID ROWLABEL ROWNUM ROWS

SELECT* SESSION SET* SHARE SIZE SMALLINT* START SUCCESSFUL SYNONYM SYSDATE TABLE* THEN TO* TRIGGER UID UNION* UNIQUE* UPDATE* USER* VALIDATE VALUES* VARCHAR VARCHAR2 VIEW* WHENEVER WHERE* WITH*

Keywords

ADMIN AFTER ALLOCATE ANALYZE ARCHIVE ARCHIVELOG AUTHORIZATION* AVG* BACKUP BEGIN* BECOME BEFORE BLOCK BODY CACHE CANCEL CASCADE CHANGE CHARACTER* CHECKPOINT CLOSE* COBOL* COMMIT* COMPILE CONSTRAINT CONSTRAINTS CONTENTS CONTINUE* CONTROLFILE COUNT* CURSOR* CYCLE

DATABASE DATAFILE DBA DEC* DECLARE* DISABLE DISMOUNT DOUBLE* DUMP EACH ENABLE END* ESCAPE* EVENTS EXCEPT EXCEPTIONS EXEC* EXPLAIN EXECUTE EXTENT EXTERNALLY FETCH* FLUSH FREELIST FREELISTS FORCE FOREIGN* FORTRAN* FOUND* FUNCTION GO* GOTO* GROUPS INCLUDING INDICATOR* INITRANS INSTANCE INT*

KEY* LANGUAGE* LAYER LINK LISTS LOGFILE MANAGE MANUAL MAX* MAXDATAFILES MAXINISTANCES MAXLOGFILES MAXLOGHISTORY MAXLOGMEMBERS MAXTRANS MAXVALUE MIN* MINEXTENTS MINVALUE MODULE* MOUNT NEXT NEW NOARCHIVELOG NOCACHE NOCYCLE NOMAXVALUE NOMINVALUE NONE NOORDER NORESETLOGS NORMAL NOSORT NUMERIC*

OFF OLD ONLY OPTIMAL OPEN* OWN PACKAGE PARALLEL PASCAL* PCTINCREASE PCTUSED PLAN PLI* PRECISION* PRIMARY* PRIVATE PROCEDURE* PROFILE QUOTA READ REAL* RECOVER REFERENCES* REFERENCING RESETLOGS RESTRICTED REUSE ROLE ROLES ROLLBACK*

SAVEPOINT SCHEMA* SCN SECTION* SEGMENT SEQUENCE SHARED SNAPSHOT SOME* SORT SQLCODE* SQLERROR* STATEMENT_ID STATISTICS STOP STORAGE SUM* SWITCH SYSTEM TABLES TABLESPACE TEMPORARY THREAD TIME TRACING TRANSACTION TRIGGERS TRUNCATE UNDER UNLIMITED UNTIL USE USING WHEN WRITE WORK*

Figure 2 - 1. Namespaces For Schema Objects

Figure 2 - 2. Namespaces For Other Objects

	emp
	"emp"
	"Emp"
	"EMP "

	emp
	EMP
	"EMP"

Examples

The following are valid examples of names:

ename
horse
scott.hiredate
"EVEN THIS & THAT!"
a_very_long_and_valid_name

Although column aliases, table aliases, usernames, or passwords are not objects or parts of objects, they must also follow these naming rules with these exceptions

Object Naming Guidelines

There are several helpful guidelines for naming objects and their parts:

When naming objects, balance the objective of keeping names short and easy to use with the objective of making name as long and descriptive as possible. When in doubt, choose the more descriptive name because the objects in the database may be used by many people over a period of time. Your counterpart ten years from now may have difficulty understanding a database with names like PMDD instead of PAYMENT_DUE_DATE.

Using consistent naming rules helps users understand the part that each table plays in your application. One such rule might be to begin the names of all tables belonging to the FINANCE application with FIN_.

Use the same names to describe the same things across tables. For example, the department number columns of the EMP and DEPT tables are both named DEPTNO.


Contents Index Home Previous Next