Breaking DataAbstract

I must say, I am not appreciating this latest breaking change of RO/DA (8.1.87.1147). There are solutions I have refined over these many years that are now broke. I have found solutions for many of them. But what is the solution for the disappearance of the :WHERE property of a TDAMemDataTable? I have this approach stitched in through out our apps. Currently, we are having to revert back to the previous version, but I need to compile against XE7

Please advise.
Regards,
Monte Carver

add uDAPlainWhere unit into uses section and use Where property as before:

table.Where.AddCondition(...);
table.Open;

Note: Legacy component should be included in DA8 setup

Thank you for the feed back. That unit fixed all the situations client side. But I am also doing the following server side with a IDADataSet. Recommendations Please…

####################
lcxn.BeginTransaction;
ds := daSchema.NewDataSet( lCxn, ‘wqry_BENEFIT_ITEM_span’ );
ds.Where.Clear;
if pi_ITEM_DTL_KEY.Count = 0 then
begin
ds.Where.AddCondition(‘BENEFIT_ITEM_KEY’, cEqual, pi_BENEFIT_ITEM_KEY);
ds.Where.AddOperator(opAnd);
ds.Where.AddCondition(‘EFF_DATE’, cEqual, fxOracleDate(pi_EFF_DATE_QUERY));
end

something like this:

if Supports(ds, IDALegacyWhereSupport, lWhereSup) then begin
   lWhere := TDAWhere.Create(nil,False);
   try
      if pi_ITEM_DTL_KEY.Count = 0 then
      begin
        lWhere.AddCondition('BENEFIT_ITEM_KEY', cEqual, pi_BENEFIT_ITEM_KEY);
        lWhere.AddOperator(opAnd);
        lWhere.AddCondition('EFF_DATE', cEqual, fxOracleDate(pi_EFF_DATE_QUERY));
      end;
      lWhereSup.WhereClause := lWhere.Clause;
   finally
     lWhere.Free;
   end;
end;

but I suggest to use DynamicWhere stuff (on server-side and client-side):

  lw:= ds.DynamicWhere;
  lw.Clear;
  lw.Expression := lw.NewBinaryExpressionList(
       lw.NewBinaryExpression('','BENEFIT_ITEM_KEY',dboEqual,pi_BENEFIT_ITEM_KEY),
       lw.NewBinaryExpression('','EFF_DATE',dboEqual,fxOracleDate(pi_EFF_DATE_QUERY)),
       dboAnd);

How do I got about replacing the following WHERE clauses with DYNAMICWHERE

        ds.Where.Clear;
        ds.Where.AddCondition('BENEFIT_ITEM_KEY', cEqual, pi_BENEFIT_ITEM_KEY);
        ds.Where.AddOperator(opAnd);
        ds.Where.AddCondition('EFF_DATE', cEqual, fxOracleDate(pi_EFF_DATE_QUERY));

        ds.Where.AddOperator(opAnd);
        ds.Where.OpenBracket;
        for i  := 0 to pi_ITEM_DTL_KEY.Count - 1 do
        begin
          if i > 0  then
            ds.Where.AddOperator(opOr);
          ds.Where.AddCondition('BENEFIT_ITEM_DTL_KEY', cEqual, pi_ITEM_DTL_KEY[i] )
        end;
        ds.Where.CloseBracket;
lw:= ds.DynamicWhere;
lw.Clear;
lw.Expression := lw.NewBinaryExpressionList(
	lw.NewBinaryExpression('','BENEFIT_ITEM_KEY',dboEqual,pi_BENEFIT_ITEM_KEY),
	lw.NewBinaryExpression('','EFF_DATE',dboEqual,fxOracleDate(pi_EFF_DATE_QUERY)),
	dboAnd);
lor := nil;
for i  := 0 to pi_ITEM_DTL_KEY.Count - 1 do
begin
  lor1 := lw.NewBinaryExpression('','BENEFIT_ITEM_DTL_KEY',dboEqual,pi_ITEM_DTL_KEY[i]));
  if lor = nil then 
    lor := lor1
  else
    lor := lw.NewBinaryExpression(lor, lor1, dboOr);
end;

lw.Expression := lw.NewBinaryExpression(lw.Expression, lor, dboAnd);

if your db supports “IN” operator, you can use dboIn:

...
ll := TDAListExpression.Create;
for i  := 0 to pi_ITEM_DTL_KEY.Count - 1 do
  ll.Add(lw.NewConstant(pi_ITEM_DTL_KEY[i]));

lw.Expression := lw.NewBinaryExpression(
  lw.Expression, 
  lw.NewBinaryExpression(
    lw.NewFieldExpression('','BENEFIT_ITEM_DTL_KEY'), 
    ll,
    dboIn),
  )
  dboAnd);

pls read Dynamic Where article where you can find list of all supported expressins and examples of usage