This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.
None required.
SET {[CURRENT [FUNCTION]] PATH | CURRENT_PATH} [=]
{ schema-name
| SYSTEM PATH
| USER
| {[CURRENT [FUNCTION]] PATH | CURRENT_PATH}
| CURRENT PACKAGE PATH
| host-variable
| string-constant
} [,...]
Set the CURRENT PATH special register to the list of schemas: "SCHEMA1", "SCHEMA#2", "SYSIBM".
SET CURRENT PATH = SCHEMA1,"SCHEMA#2", SYSIBM;
If the special register provides the SQL path, then SYSPROC, which was not explicitly specified in the special register, is implicitly assumed at the front of the SQL path, making the effective value of the path:
SYSPROC, SCHEMA1, SCHEMA#2, SYSIBM
Description
The value of CURRENT PATH is replaced by the values specified.
The schema name must:
A character string constant that represents a valid schema name.
If the schema name specified in string-constant will also be specified in other SQL statements and the schema name does not conform to the rules for ordinary identifiers, the schema name must be specified as a delimited identifier in the other SQL statements.
There is a difference between specifying USER with and without escape characters. To indicate that the value of the USER special register should be used in the SQL path, specify the keyword USER. If you specify USER as a delimited identifier instead (for example, "USER"), it is interpreted as a schema name of "USER". For example, assuming that the current value of the USER special register is SMITH, SET CURRENT PATH = SYSIBM, SYSPROC, USER, "USER" results in SYSIBM, SYSPROC, SMITH, USER being used in the SQL path.
Specifying a schema name in an SQL procedure