CURRENT PATH

The CURRENT PATH special register specifies the SQL path used to resolve unqualified distinct type names, function names, and procedure names in dynamically prepared SQL statements. It is also used to resolve unqualified procedure names that are specified as variables in SQL CALL statements (CALL variable). The data type is VARCHAR(3483).

The CURRENT PATH special register contains the value of the SQL path which is a list of one or more schema names, where each schema name is enclosed in delimiters and separated from the following schema by a comma. The delimiters and commas are included in the length of the special register. The maximum number of schema names in the path is 268.

For information on when the SQL path is used to resolve unqualified names in both dynamic and static SQL statements and the effect of its value, see Unqualified function, procedure, specific, and distinct type names.

The initial value of the CURRENT PATH special register in an activation group is established by the first SQL statement that is executed.

The value of the special register can be changed by executing the SET PATH statement. For details about this statement, see SET PATH. For portability across the platforms, it is recommended that a SET PATH statement be issued at the beginning of an application.

Example

Set the special register so that schema SMITH is searched before schemas QSYS and QSYS2 (SYSTEM PATH).

   SET CURRENT PATH SMITH, SYSTEM PATH