2. Introducing SQL : SQL Naming and Statement Rules : Object Naming Rules
 
Share this page                  
Object Naming Rules
The rules for naming database objects (such as tables, columns, views, and database procedures) are as follows:
Names can contain only alphanumeric characters and must begin with an alphabetic character or an underscore (_). Database names must begin with an alphabetic character, and cannot begin with an underscore.
Case significance (upper or lower) is determined by the settings for the database in which the object is created (Ingres or ANSI/ISO Entry SQL-92-compliant) and differs for regular and delimited identifiers (see page Regular and Delimited Identifiers).
Names can contain (but cannot begin with) the following special characters: 0 through 9, #, @, and $. Names specified as delimited identifiers (in double quotes) can contain additional special characters.
For details about delimited identifiers, see Regular and Delimited Identifiers (see page Regular and Delimited Identifiers).
Database objects cannot begin with the letters, ii. This name is reserved for use by the DBMS Server.
The maximum length of names for the following objects is 256 bytes:
Table
Column
Partition
Procedure
Procedure parameter
Rule
Sequence
Synonym
Object
Constraint
In an installation that uses the UTF8 or any other multi-byte character set, the maximum length of a name may be less than 256 bytes because some glyphs use multiple bytes.
The maximum length of names for the following objects is 32 bytes:
Database
Owner
User
Group
Profile
Role
Schema
Location
Event
Alarm
Node
Objects managed by the Ingres interfaces such as Query-By-Forms, Report-By-Forms, Vision, and Visual Forms Editor (for example: Forms, JoinDefs, QBFnames, Graphs, Reports)
Database names must be unique to 24 bytes (or the maximum file name length imposed by your operating system, if less than 24).
The maximum length of a name for a collation sequence is 64 bytes.
Avoid assigning reserved words as object names. A list of reserved words can be found in the appendix “Keywords.”
For ANSI/ISO Entry SQL-92 compliant databases, the maximum length of an object name is 18 bytes.