SQL Reference

CURRENT NODE

The CURRENT NODE special register specifies an INTEGER value that identifies the coordinator node number (the partition to which an application connects).

CURRENT NODE returns 0 if the database instance is not defined to support partitioning (no db2nodes.cfg file 21 ).

The CURRENT NODE can be changed by the CONNECT statement, but only under certain conditions (see CONNECT (Type 1)).

Example

Set the host variable APPL_NODE (integer) to the number of the partition to which the application is connected.

   VALUES CURRENT NODE
     INTO :APPL_NODE

Footnotes:

21
For partitioned databases, the db2nodes.cfg file exists and contains partition (or node) definitions. For details refer to the Administration Guide.


[ Top of Page | Previous Page | Next Page ]