The statement looks like this
select
d.del_date_allocation_id, d.region_id, d.del_date,
coalesce(d.stop_allocation,0) as stop_allocation, coalesce(d.piece_allocation,0) as piece_allocation,
d.upd_user_id, r.name as region_name, count(distinct s.id) as stop_qty,
coalesce(sum(m.qty),0) as piece_qty
from
del_date_allocation d
join region r on (r.region_id = d.region_id+0)
left join account_hub a on (a.del_date_allocation_pool_id = d.del_date_allocation_pool_id)
left join sched_sale s on (s.del_date = d.del_date and s.region_id = d.region_id and s.account_id = a.account_id and s.salescheck_status_id in (1,5))
left join sched_mdse m on (m.sched_sale_id = s.id)
where
r.active_flag = 'Y'
group by
d.del_date_allocation_id, d.region_id, d.del_date, d.stop_allocation, d.piece_allocation,
d.upd_user_id, r.name
order by
d.del_date, r.name
So obviously i do not need to update region_name, but only the fields from del_date_allocation table.
I tried to set ReadOnly to TRUE and LogChanges to FALSE for these fields on client-side in TDAMemDataTable but seems like updates are being generates anyway.
Thanks.