FIELDTYPE function
The FIELDTYPE field function returns the type of a given field.
Syntax
FIELDTYPE returns an integer representing the type of the field identified by source_field_reference; this is the type of the field, not the data type of the field that the parameter identifies. If the parameter identifies a nonexistent entity, NULL is returned.
The mapping of integer values to field types is not published, and might change from release to release. Compare the results of the FIELDTYPE function with named field types.
For example:
IF FIELDTYPE(source_field_reference) = NameValue
THEN ...
The named field types that you can use in this context are listed in this section. You must use these types with the capitalization shown.
The following types are domain-independent:
- Name
- Value
- NameValue
- MQRFH2.BitStream
- MQRFH2.Field
- MQRFH2C.Field
The XML.* types are
applicable to the XML, XMLNS, JMSMap, and JMSStream domains, except
for XML.NamespaceDecl, which is specific to the
XML domain.
- XML.AsisElementContent
- XML.Attribute
- XML.AttributeDef
- XML.AttributeDefDefaultType
- XML.AttributeDefType
- XML.AttributeDefValue
- XML.AttributeList
- XML.BitStream
- XML.CDataSection
- XML.Comment
- XML.Content
- XML.DocTypeCommentt
- XML.DocTypeDecl
- XML.DocTypePI
- XML.DocTypeWhiteSpace
- XML.Element
- XML.ElementDef
- XML.Encoding
- XML.EntityDecl
- XML.EntityDeclValue
- XML.EntityReferenceEnd
- XML.EntityReferenceStart
- XML.EntityValue
- XML.ExternalEntityDecl
- XML.ExternalParameterEntityDecl
- XML.ExtSubset
- XML.IntSubset
- XML.NamespaceDecl
- XML.NotationDecl
- XML.NotationReference
- XML.Opaque
- XML.ParameterEntityDecl
- XML.ParserRoot
- XML.ProcessingInstruction
- XML.PublicId
- XML.RequestedDomain
- XML.Standalone
- XML.SystemId
- XML.UnparsedEntityDecl
- XML.Version
- XML.WhiteSpace
- XML.XmlDecl
The XMLNSC.* types are applicable to
the XMLNSC domain. The same constants can also be prefixed with SOAP.* for
use in the SOAP domain.
- XMLNSC.AnyCData
- XMLNSC.AnyHybrid
- XMLNSC.AnyPCData
- XMLNSC.AnyValue
- XMLNSC.AsisElementContent
- XMLNSC.Attribute
- XMLNSC.base64Binary
- XMLNSC.BitStream
- XMLNSC.CDataField
- XMLNSC.CDataValue
- XMLNSC.Comment
- XMLNSC.DocumentType
- XMLNSC.DoubleAttribute
- XMLNSC.DoubleEntityDefinition
- XMLNSC.DoubleNamespaceDecl
- XMLNSC.Element
- XMLNSC.EntityDefinition
- XMLNSC.EntityReference
- XMLNSC.Field
- XMLNSC.Folder
- XMLNSC.gDay
- XMLNSC.gMonth
- XMLNSC.gMonthDay
- XMLNSC.gYear
- XMLNSC.gYearMonth
- XMLNSC.HybridField
- XMLNSC.HybridValue
- XMLNSC.NamespaceDecl
- XMLNSC.Opaque
- XMLNSC.PCDataField
- XMLNSC.PCDataValue
- XMLNSC.ProcessingInstruction
- XMLNSC.SingleAttribute
- XMLNSC.SingleEntityDefinition
- XMLNSC.SingleNamespaceDecl
- XMLNSC.Value
- XMLNSC.XmlDeclaration
You can also use this function to determine whether a
field in a message exists. To do this, use the form:
FIELDTYPE(SomeFieldReference) IS NULL
If
the field exists, an integer value is returned to the function that
indicates the field type (for example, string). When this is compared
to NULL, the result is FALSE. If the field does not exist, NULL is
returned and therefore the result is TRUE. For example:
IF FIELDTYPE(InputRoot.XMLNS.Message1.Name)
IS NULL THEN
// Name field does not exist, take error
action....
... more ESQL ...
ELSE
// Name field does exist, continue....
... more ESQL ...
END IF