WhereList Object

The WhereList Object is a WhereExpression subclass that contains a list of other values. It can be used on the right side of a BinaryExpression for expressions like a in [1,2,3]. The default indexer for this object gives access to the items by index.

Where expressions are used to filter a request by applying extra conditions. They are generally stored as XML formatted strings, however, the scripting implementation can unwrap these into a tree. The WhereBuilder object can be used to create new instances of these objects.

The code snippet below shows how the WhereList Object can be used:

 var Value1 = 1;
 var Value2 = 2;
 var Value3 = 3;
 var Field = WhereBuilder.createField('CustomerID');
 var List = WhereBuilder.createList([WhereBuilder.createConstant(Value1,'int'),
                                    WhereBuilder.createConstant(Value2,'int'),
                                    WhereBuilder.createConstant(Value3,'int')]);
 List.removeAt(0);
 var b = WhereBuilder.createBinary( Field, List, 'In');

Properties

count

Returns the number of entries in this SQL list.

Functions

add(value)

Adds a new expression to the list.

remoteAt(index)

Removes an entry in the list.

insert(index, value)

Inserts an item at a specific index.