SAND CDBMS SQL Reference Guide
SAND CDBMS SQL Database Objects and Language Elements

 

x
Chapter Index
Next Topic:
User Authorizations and Privileges

 

Object Names


A database object is a named element of database structure that is brought into existence with an SQL CREATE... or ALTER... statement. This includes tables, columns, domains, schemas, views, constraints, connections, materialized joins, user authorizations, and passwords.

The names assigned to SAND CDBMS database objects must conform to the following guidelines involving characters, digits, and symbols. Note that a user password is considered an object name, and must therefore follow the same rules.

Object names must begin with a letter, and may be as long as 128 characters. Any object name may be delimited by double quotation marks ( "..." ). (Note that single quotation marks are reserved for string literals.) When delimited by quotes, the identifier may begin with a non-letter and can contain any character with an ASCII value between 32 and 255 inclusive, except for a period ( . ). The allowable set of characters for non-delimited database object names is the following:

UNIX Windows
rose'&'bud rose"&"bud
rose"&"bud "rose&bud"
'rose&bud'  
"rose&bud"  


Regardless of delimited identifiers, all alphabetical characters (except those contained in passwords) are mapped to uppercase when stored in the system tables.

It is strongly recommended that SAND CDBMS SQL keywords not be used as object names. If a keyword is used as an object name, attempting to reference the object may cause problems in certain contexts. For example, if a table "T1" is defined with a column called "ALL" (a keyword), the query ‘SELECT ALL FROM T1’ will produce a syntax error.

The types of database object to which this restriction applies are the following:


Qualified Names

Certain object names may be referenced in SQL statements using qualifiers: that is, the object name may be preceded by the name of the object to which it belongs, with the two names separated by a period ( . ). A column name may be preceded by the table name (or table correlation name) to which it belongs: for example, state.ab is the ab column of the state table. Similarly, a table name may be preceded by a qualifying schema name: for instance, learn.state is the state table in the learn schema; vip.state is the state table in the vip schema. View, domain, and materialized join names may also be qualified with the name of the schema to which they belong.

To eliminate ambiguity when referring to columns, their names can be qualified by both their table and their schema name: the column name is preceded by its table name, and this is preceded by the name of the schema to which the table belongs (that is, schema.table.column). A column name that is qualified in this way will always be unambiguous, since the schema name is unique within the database, the table name is unique within that schema, and the column name is in turn unique within that table.

 

x
Chapter Index
Next Topic:
User Authorizations and Privileges