The FIELDVALUE field function returns the scalar value of a given field.
Syntax :-
FIELDVALUE ( source_field_reference )
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>
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.
Syntax :-
FIELDVALUE ( source_field_reference )
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>
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.