WhereParameter Object

The WhereParameter Object is a WhereExpression subclass used to define a SQL parameter, the value for this is passed separately from the Where XML; generally, this would be used to pass blobs.

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 WhereParameter Object can be used:

 var where = WhereBuilder.createBinary(WhereBuilder.createField('Id'), WhereBuilder.createParameter('Id', 'String', 50), 'Equal');
 var users = lda.selectWhere('Customers', [ 'Id', 'Name' ], where, { Id: '{3217032b-47db-400a-9a6e-012cbdf1e1e5}' });
 log(users.count);

Properties

name

Represents the name of the parameter; this will be looked up from the separately passed parameters.

type

Represents the type of the parameter, can be one of the following:

Unknown AutoInc Blob Boolean
Byte Cardinal Currency DateTime
Decimal FixedChar FixedWideChar Float
Guid Integer LargeAutoInc LargeInt
LargeUInt Memo SingleFloat ShortInt
SmallInt String WideMemo WideString
Word Xml    

size

Represents the size of the parameter for strings/varchar, for other types this field is ignored.