FIELDVALUE function

The FIELDVALUE field function returns the scalar value of a given field.

SYNTAX

FIELDVALUE returns the scalar value of the field identified by source_field_reference. If it identifies a non-existent field, NULL is returned.

For example, consider the following XML input message:
<Data>
   <Qty Unit="Gallons">1234</Qty>
</Data>        
The ESQL statement
SET OutputRoot.XML.Data.Quantity = 
    FIELDVALUE(InputRoot.XML.Data.Qty);
gives the result:
<Data><Quantity>1234</Quantity></Data>
whereas this ESQL statement (without the FIELDVALUE function):
SET OutputRoot.XML.Data.Quantity = 
    InputRoot.XML.Data.Qty;
causes a tree copy, with the result:
<Data><Quantity Unit="Gallons">1234</Quantity></Data>
because the field Qty is not a leaf field.
Related concepts
ESQL overview
Related tasks
Developing ESQL
Accessing attributes in XML messages
Related reference
Syntax diagrams: available types
ESQL field functions