How to define updates for the following datatable

(egold2005) #1

The statement looks like this

   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, as region_name, count(distinct as stop_qty, 
   coalesce(sum(m.qty),0) as piece_qty
   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 =
   r.active_flag = 'Y'
group by
   d.del_date_allocation_id, d.region_id, d.del_date, d.stop_allocation, d.piece_allocation,
order by

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.


(EvgenyK) #2

you need to define ReadOnly & LogChanges in schema on server-side, because delta commands (Insert/Update/Delete) are generated by server-side according to table schema

(egold2005) #3

Thanks Evgeny, however even if i define them on server-side it does not help.

(EvgenyK) #4

can you show SQL for Insert and/or Update delta commands?

you can generate them inside schema and remove later

P.S. have you refreshed table schema on client side after making changes on server-side?

(egold2005) #5

Thanks Evgeny, i got it working. I missed to create statements for updates initially.