ifx_node_name() function

The ifx_node_name() function returns the name of the grid server on which the function is run.

Syntax


1  EXECUTE FUNCTION ifx_node_name ( ) ;

Usage

Use the ifx_node_name() function in the context of a grid query to return the name of each server on which the grid query is run. Include the ifx_node_name() function in the SELECT statement of a grid query. The server name is returned as a result column to identify the origin of the other results of the query.

If you run the ifx_node_name() function outside of the context of a grid query, the function returns the name of the local server, unless you prefix the remote database and server name, for example: db@serv4:ifx_node_name().

Example

The following grid query selects the server name and the total sales from a grid named SE_USA and groups the results by the server name:

SELECT ifx_node_name() AS node, sum(amt) AS total_sales  
FROM sales GRID ALL 'SE_USA'
GROUP BY node;

node         Atlanta
total_sales  $2100.00

node         Birmingham
total_sales  $2160.00

node         Nashville
total_sales  $2000.00

node         Jacksonville
total_sales  $2040.00