IBM Books

SQL Reference


Naming Conventions and Implicit Object Name Qualifications

The rules for forming a name depend on the type of the object designated by the name. Database object names may be made up of a single identifier or they may be schema qualified objects made up of two identifiers. Schema qualified object names may be specified without the schema name. In such cases, a schema name is implicit.

In dynamic SQL statements, a schema qualified object name implicitly uses the CURRENT SCHEMA special register value as the qualifer for unqualified object name references. By default it is set to the current authorization ID. See SET SCHEMA for details.

In static SQL statements, the QUALIFIER precompile/bind option implicitly specifies the qualifier for unqualified database object names. By default it is set to authorization ID of the binder. See the Command Reference for details.

The syntax diagrams use different terms for different types of names. The following list defines these terms.

alias-name
A schema qualified name that designates an alias. The unqualified form of an alias-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier.

attribute-name
A long identifier that designates an attribute of a structured data type.

authorization-name
A short identifier that designates a user or group. Note the following restrictions on the characters that can be used:

bufferpool-name
A long identifier that designates a bufferpool.

column-name
A qualified or unqualified name that designates a column of a table or view. The unqualified form of a column-name is a long identifier. The qualified form is a qualifier followed by a period and a long identifier. The qualifier is a table-name, a view-name, or a correlation-name.

constraint-name
A long identifier that designates a referential constraint, primary key constraint, unique constraint or a table check constraint.

correlation-name
A long identifier that designates a table or a view.

cursor-name
A long identifier that designates an SQL cursor.

descriptor-name
A colon followed by a host identifier that designates an SQL descriptor area (SQLDA). See References to Host Variables for a description of a host identifier. Note that a descriptor-name never includes an indicator variable.

distinct-type-name
A qualified or unqualified name that designates a distinct type-name. The unqualified form of a distinct-type-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier. An unqualified distinct-type-name in an SQL statement is implicitly qualified by the database manager, depending on context.

event-monitor-name
A long identifier that designates an event monitor.

function-name
A qualified or unqualified name that designates a function. The unqualified form of a function-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier. An unqualified function-name in an SQL statement is implicitly qualified by the database manager, depending on context.

host-variable
A sequence of tokens that designates a host variable. A host variable includes at least one host identifier, as explained in References to Host Variables.

index-name
A schema qualified name that designates an index. The unqualified form of an index-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier.

nodegroup-name
A long identifier that designates a nodegroup.

package-name
A schema qualified name that designates a package. The unqualified form of a package-name is a short identifier. The qualified form is a short identifier followed by a period and a short identifier.

procedure-name
A qualified or unqualified name that designates a procedure. The unqualified form of a procedure-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier. An unqualified procedure-name in an SQL statement is implicitly qualified by the database manager, depending on context.

schema-name
A short identifier that provides a logical grouping for SQL objects. A schema-name used as a qualifier of the name of an object may be implicitly determined:

server-name
A long identifier that designates an application server.

specific-name
A qualified or unqualified name that designates specific-name. The qualified form is a schema-name followed by a period and a long identifier. A specific-name can be used to source a function, to drop and to comment on a procedure or a function. It can never be used to invoke a function or procedure. An unqualified specific-name in an SQL statement is implicitly qualified by the database manager, depending on context.

statement-name
A long identifier that designates a prepared SQL statement.

supertype-name
A qualified or unqualified name that designates a the supertype of a type-name. The unqualified form of a supertype-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier. An unqualified supertype-name in an SQL statement is implicitly qualified by the database manager, depending on context.

table-name
A schema qualified name that designates a table. The unqualified form of a table-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier.

tablespace-name
A long identifier that designates a table space.

trigger-name
A schema qualified name that designates a trigger. The unqualified form of a trigger-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier.

type-name
A qualified or unqualified name that designates a type-name. The unqualified form of a type-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier. An unqualified type-name in an SQL statement is implicitly qualified by the database manager, depending on context.

typed-table-name
A schema qualified name that designates a typed table. The unqualified form of a typed-table-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier.

typed-view-name
A schema qualified name that designates a typed view. The unqualified form of a typed-view-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier.

view-name
A schema qualified name that designates a view. The unqualified form of a view-name is a long identifier. The qualified form is a short identifier followed by a period and a long identifier.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]