Determining the data sharing member on which SQL statements run
Use the special register CURRENT MEMBER to determine the member of a data sharing group on which SQL statements execute.
The data type of CURRENT MEMBER is CHAR(8). If necessary, the member name is padded on the right with blanks so that its length is 8 bytes. The value of CURRENT MEMBER is a string of blanks when the application process is connected to a Db2 subsystem that is not a member of a data sharing group.
Example: To set the host variable MEM to the name of the current member, use one of the following statements:
EXEC SQL SET :MEM = CURRENT MEMBER;
EXEC VALUES (CURRENT MEMBER) INTO :MEM