DB2 Version 9.7 for Linux, UNIX, and Windows

SET PATH statement

The SET PATH statement changes the value of the CURRENT PATH special register. It is not under transaction control.

Invocation

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.

Authorization

None required.

Syntax

Read syntax diagramSkip visual syntax diagram
          .-CURRENT-.          .-=-.   
>>-SET--+-+---------+--PATH-+--+---+---------------------------->
        '-CURRENT_PATH------'          

   .-,------------------------.   
   V                          |   
>----+-schema-name----------+-+--------------------------------><
     +-SYSTEM PATH----------+     
     +-USER-----------------+     
     +-+-CURRENT PATH-+-----+     
     | '-CURRENT_PATH-'     |     
     +-CURRENT PACKAGE PATH-+     
     +-host-variable--------+     
     '-string-constant------'     

Description

schema-name
This one-part name identifies a schema that exists at the application server. No validation that the schema exists is made at the time that the path is set. If a schema-name is, for example, misspelled, the error will not be caught, and it could affect the way subsequent SQL operates.
SYSTEM PATH
This value is the same as specifying the schema names "SYSIBM","SYSFUN","SYSPROC","SYSIBMADM".
USER
The value of the USER special register.
CURRENT PATH
The value of the CURRENT PATH special register before this statement executes.
CURRENT PACKAGE PATH
The value of the CURRENT PACKAGE PATH special register.
host-variable
A variable of type CHAR or VARCHAR. The length of the contents of the host-variable must not exceed 128 bytes (SQLSTATE 42815). It cannot be set to null. If host-variable has an associated indicator variable, the value of that indicator variable must not indicate a null value (SQLSTATE 42815).

The characters of the host-variable must be left justified. When specifying the schema-name with a host-variable, all characters must be specified in the exact case intended as there is no conversion to uppercase characters.

string-constant
A character string constant with a maximum length of 128 bytes.

Rules

Notes

Examples

Example 1:  The following statement sets the CURRENT PATH special register.
   SET PATH = FERMAT, "McDrw #8", SYSIBM
Example 2:  The following example retrieves the current value of the CURRENT PATH special register into the host variable called CURPATH.
   EXEC SQL VALUES (CURRENT PATH) INTO :CURPATH;

The value would be "FERMAT","McDrw #8","SYSIBM" if set by the previous example.