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.
array-type-name
A
qualified or unqualified name that designates an array type. The qualified
form of a array-type-name depends upon the
naming option. For SQL naming, the qualified form is a schema-name followed
by a period (.) and an SQL identifier. For system naming, the qualified
form is a schema-name followed by a slash
(/) followed by an SQL identifier. The unqualified form of a array-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, array-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 procedure.

Column names cannot be qualified for system naming 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 implicit or explicit qualifier must be the same as the schema name of the table.
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.
system-schema-name
followed by a period
(.) and a system identifier. For system naming, the qualified form
is a
system-schema-name
followed
by a slash (/) followed by a system identifier. 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.
For a service program name, the qualified form depends
on the naming option. For SQL naming the qualified form is a
system-schema-name
followed by a period
(.), followed by a system identifier for the service program name,
followed by a left parenthesis, followed by an IBM® i entry-point-name,
followed by a right parenthesis (library-name.service-program-name(entry-point-name)).
For system naming, the qualified form is a
system-schema-name
followed
by a slash (/) followed by a system identifier for the service program
name, followed by a left parenthesis, followed by an IBM i entry-point-name,
followed by a right parenthesis (library-name/service-program-name(entry-point-name)).
If the entry point name contains lowercase characters,
it must be enclosed in quotes.

The unqualified
form of an service program name is a system identifier followed by
a left parenthesis, followed by an IBM i entry-point-name,
followed by a right parenthesis. 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 naming, 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.
For system naming, 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 an SQL identifier.
If the server-name is
used to qualify the name of the schema, the server-name may
identify any supported remote server. Otherwise, the schema name is
implicitly qualified with 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.
An
unqualified name that designates the IBM i name of a table, view,
index, sequence, variable, or alias. A system-object-name is
a system identifier. If the unqualified name of the table, view, index, sequence, variable, or alias is a valid system identifier, the system-object-name of the table, view, index, sequence, variable, or alias is the unqualified name of the table, view, index, sequence, or alias.

system-schema-name
An
unqualified name that designates the IBM i name of a schema.
A system-schema-name is a system identifier.
If the unqualified name of the schema is a valid system identifier, the system-schema-name of the schema is the unqualified name of the schema.

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.
variable-name
A
qualified or unqualified name that designates a global variable. The
qualified form of a variable-name depends
upon the naming option. For SQL naming, the qualified form is a schema-name followed
by a period (.) and an SQL identifier. For system naming, the qualified
form is a schema-name followed by a slash
(/) followed by an SQL identifier. For system naming, a variable-name cannot
be qualified when used in an expression (the qualified form is only
allowed in SQL schema statements).The unqualified form of a variable-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.
A variable-name can specify either the name of the variable or the system object name of the variable.

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.
xsrobject-name
A
qualified or unqualified name that designates an object in the XML
schema repository. The qualified form of an xsrobject-name depends
upon the naming option. For SQL naming, the qualified form is a schema-name followed
by a period (.) and an SQL identifier. For system naming, the qualified
form is a schema-name followed by a slash
(/) followed by an SQL identifier. The unqualified form of an xsrobject-name is an SQL identifier. The unqualified form is implicitly qualified based on the rules specified in Qualification of unqualified object names.

| Identifier Type | Maximum Length |
|---|---|
| Longest authorization name1 | 10 |
| Longest correlation name | 128 |
| Longest cursor name | 128 |
| Longest external program name (string form) | 279 |
| Longest external program name (unqualified form)2 | 10 |
| Longest host identifier | 64 |
| Longest partition name | 10 |
| Longest savepoint name | 128 |
Longest schema name![]() |
128![]() |
| Longest server name | 18 |
| Longest SQL condition name | 128 |
| Longest SQL descriptor name | 128 |
| Longest SQL label | 128 |
| Longest statement name | 128 |
| Longest unqualified alias name | 128 |
Longest unqualified array type 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 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 system schema
name![]() |
10![]() |
| Longest unqualified table and view name | 128 |
| Longest unqualified trigger name | 128 |
Longest unqualified variable name![]() |
128![]() |
Longest unqualified XSR object name![]() |
128![]() |