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
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
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