WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

SINGULAR function

The SINGULAR function returns a Boolean value that indicates whether a list contains exactly one element.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-SINGULAR--(--ListExpression--)------------------------------><

If the list specified by ListExpression contains exactly one element, SINGULAR returns TRUE. If the list contains more or fewer elements, SINGULAR returns FALSE.

ListExpression is an expression that returns a list. All the following expressions, for example, return a list:
  • A LIST constructor
  • A field reference with the [] array indicator
  • Some SELECT expressions (not all return a list)

If you want to know only whether a list contains just one element or some other number, SINGULAR executes more quickly than an expression involving the CARDINALITY function (for example, CARDINALITY(ListExpression ) = 1).

A typical use of this function is to determine whether a field is unique.

Examples

-- Determine whether there is just one F1 field in the message.
-- Note that the [ ] are required
DECLARE Field1Unique BOOLEAN SINGULAR(OutputRoot.XMLNS.Data.Source.F1[]);
-- Determine whether there is just one field called F1 with the value 'F12'
-- in the message. Again note that the [ ] are required
DECLARE Field1F12Unique BOOLEAN
  SINGULAR(SELECT F.* FROM OutputRoot.XMLNS.Data.Source.F1[] AS F where F = 'F12'); 
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:47:12


Reference topicReference topic | Version 8.0.0.7 | ak05585_