element_name() and nelement_name() functions

The element_name() and nelement_name() functions return the name of an element if it exists.

Syntax

The element_name() function has the following syntax:
varchar = element_name(array input, int index);
The nelement_name() function is the Unicode form of the function and has the following syntax:
nvarchar = nelement_name(array input, int index);

The input value specifies the array that contains the named element.

The index value specifies the element for which to retrieve the name.

Returns

The functions return the name of the element if it exists.

Example

In the following example, the element name of index 1 is returned:
select element_name(add_element(array(4),4,'Netezza'),1);
element_name 
--------------
 Netezza
(1 row)