The rules for forming a name depend on the type of the object designated by the name and the naming option (*SQL or *SYS). The naming option is specified on the CRTSQLxxx, RUNSQLSTM, and STRSQL commands. The SET OPTION statement can be used to specify the naming option within the source of a program containing embedded SQL. The syntax diagrams use different terms for different types of names. The following list defines these terms.
The unqualified form of an alias-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
An alias-name can specify either the name of the alias or the system object name of the alias.
Column names cannot be qualified with system names in the form schema-name/table-name.column-name, except in the COMMENT and LABEL statements. If column names need to be qualified, and correlation names are allowed in the statement, a correlation name must be used to qualify the column.
A column-name can specify either the column name or the system column name of a column of a table or view. If a column-name is delimited, the delimiters are considered to be part of the name when determining the length of the name.
The unqualified form of a constraint-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
The unqualified form of a distinct-type-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
For system naming, distinct-type-names cannot be qualified when used in a parameter data type of an SQL routine or in an SQL variable declaration in an SQL function, SQL procedure, or trigger.
The unqualified form of an external-program-name is a system identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
The format of the character string form is either:
>>-+-------------+--class-id--+-!-+--method-id----------------->< '-jar-name--:-' '-.-'
The class-id identifies the class identifier of the Java object. If the class is part of a Java package, the class identifier must include the complete Java package prefix. For example, if the class identifier is 'myPackage.StoredProcs', the Java virtual machine will look in the following directory for the StoredProcs class:
'/QIBM/UserData/OS400/SQLLib/ Function/myPackage/StoredProcs/'
The method-id identifies the method name of the public, static Java method to be invoked.
This form is only valid for Java procedures and Java functions.
The unqualified form of a function-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
For system naming, functions names can only be qualified in the form schema-name/function-name when the name is used in a CREATE, COMMENT, DROP, GRANT, or REVOKE statement.
The unqualified form of an index-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
The qualified form of a nodegroup-name depends on the naming option. For SQL naming, the qualified form is a schema-name followed by a period (.) and a system identifier. For system naming, the qualified form is a schema-name followed by a slash (/) followed by a system identifier.
The unqualified form of a nodegroup-name is a system identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
The unqualified form of a package-name is a system identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
The unqualified form of a procedure-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
For SQL names, the unqualified schema name in an SQL statement is implicitly qualified by the server-name. The qualified form is a server-name followed by a (.) and a system identifier. The server-name must identify the current server.
For system names, the unqualified schema name in an SQL statement is implicitly qualified by the server-name. The qualified form is a server-name followed by a slash (/) and a system identifier. The server-name must identify the current server.
The unqualified form of a sequence-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
A sequence-name can specify either the name of the sequence or the system object name of the sequence.
The unqualified form of a specific-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
If a variable is used to designate the SQL descriptor:
Leading and trailing blanks are trimmed from the variable or string. See References to host variables for a description of a variable.
If a string constant is used to designate the SQL descriptor, the length of the constant must not exceed the maximum length for an SQL-descriptor-name.
If the unqualified name of the table, view, index, sequence, or alias is a valid system identifier, the system-object-name of the table, view, index, sequence, or alias is the unqualified name of the table, view, index, sequence, or alias.
The unqualified form of a table-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
A table-name can specify either the name of the table or the system object name of the table.
The unqualified form of a trigger-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
The unqualified form of a view-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
A view-name can specify either the name of the view or the system object name of the view.
Identifier Type | Maximum Length |
---|---|
Longest authorization name17 | 10 |
Longest condition name | 128 |
Longest correlation name | 128 |
Longest cursor name | 18 |
Longest external program name (unqualified form)18 | 10 |
Longest external program name (string form) | 279 |
Longest host identifier | 64 |
Longest partition name | 10 |
Longest savepoint name | 128 |
Longest schema name | 10 |
Longest server name | 18 |
Longest SQL-descriptor-name | 128 |
Longest SQL label | 128 |
Longest statement name | 18 |
Longest unqualified alias name | 128 |
Longest unqualified column name | 128 |
Longest unqualified constraint name | 128 |
Longest unqualified distinct type name | 128 |
Longest unqualified function name | 128 |
Longest unqualified index name | 128 |
Longest unqualified nodegroup name | 10 |
Longest unqualified package name | 10 |
Longest package version-id | 64 |
Longest unqualified parameter name | 128 |
Longest unqualified procedure name | 128 |
Longest unqualified sequence name | 128 |
Longest unqualified specific name | 128 |
Longest unqualified SQL parameter name | 128 |
Longest unqualified SQL variable name | 128 |
Longest unqualified system column name | 10 |
Longest unqualified system object name | 10 |
Longest unqualified table and view name | 128 |
Longest unqualified trigger name | 128 |
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.