NullExpression

The NullExpression is part of the Dynamic Where feature; it represents a NULL value.

Implementation

Example of usage

Target SQL where clause:

WHERE client_address IS NULL

WhereExpression where = new BinaryExpression(
                          new FieldExpression("CLIENTS", "Client_Address"),
                          new NullExpression(),
                          BinaryOperator.Equal);

let whereExpression = BinaryExpression(
                        FieldExpression("CLIENTS", "Client_Address"),
                        NullExpression(),
                        BinaryOperator.Equal)

WhereExpression where = new BinaryExpression(
                            new FieldExpression("CLIENTS", "Client_Address"),
                            new NullExpression(),
                            BinaryOperator.Equal);

let whereExpression = BinaryExpression(
                        FieldExpression("CLIENTS", "Client_Address"),
                        NullExpression(),
                        BinaryOperator.Equal)

with ClientDataModule.tbl_CLIENTS,DynamicWhere do begin
   Expression:=NewBinaryExpression(
                 NewField(LogicalName,'Client_Address'),
                 NewNull(),
                 dboEqual);
end;

myTable.dynamicWhere = new RemObjects.DataAbstract.DynamicWhere(
              new RemObjects.DataAbstract.BinaryExpression(
                new RemObjects.DataAbstract.FieldExpression("Client_Address"),
                new RemObjects.DataAbstract.NullExpression(), "Equal")
            ));

Generated XML

<?xml version="1.0"?>
<query xmlns="http://www.remobjects.com/schemas/dataabstract/queries/5.0" version="5.0">
  <where>
    <binaryoperation operator="Equal">
      <field tablename="CLIENTS">Client_Address</field>
      <null/>
    </binaryoperation>
  </where>
</query>