Notes
Transaction considerations: The SET PATH statement
is not a commitable operation. ROLLBACK has no effect on the CURRENT PATH.
Rules for the content of the SQL path:
- A schema name must not appear more than once in the path.
- The number of schemas that can be specified is limited by the total length
of the CURRENT PATH special register. The special register string is built
by taking each schema name specified and removing trailing blanks, delimiting
with double quotes, and separating each schema name by a comma. An error is
returned if the length of the resulting string exceeds 3483 bytes. A maximum
of 268 schema names can be represented in the path.
- There is a difference between specifying a single keyword (such as USER,
or PATH, or CURRENT_PATH) as a single keyword, or as a delimited identifier.
To indicate that the current value of a special register specified as a single
keyword should be used in the SQL path, specify the name of the special register
as a keyword. If the name of the special register is specified as a delimited
identifier instead (for example, "USER"), it is interpreted as a schema name
of that value ('USER'). For example, assuming that the current value of the
USER special register is SMITH, then SET PATH = SYSIBM, USER, "USER" results
in a CURRENT PATH value of "SYSIBM","SMITH","USER".
- The following rules are used to determine whether a value specified in
a SET PATH statement is a variable or a schema-name:
- If name is the same as a parameter or SQL variable in the SQL
procedure, name is interpreted as a parameter or SQL variable, and
the value in name is assigned to PATH.
- If name is not the same as a parameter or SQL variable in the
SQL procedure, name is interpreted as schema-name, and the
value name is assigned to PATH.
The System Path: SYSTEM PATH refers to the system
path for a platform. The schemas QSYS and QSYS2 do not need to be specified.
If not included in the path, they are implicitly assumed as the last schemas
(in this case, it is not included in the CURRENT PATH special register).
The initial value of the CURRENT PATH special register is *LIBL if system
naming was used for the first SQL statement run in the activation group. The
initial value is "QSYS","QSYS2", "X" (where X is the value of the USER special
register) if SQL naming was used for the first SQL statement.
Using the SQL path: The CURRENT PATH special
register is used to resolve user-defined distinct types, functions, and procedures
in dynamic SQL statements. For more information see SQL path.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.