Why delete doesn't apply ?
-
Monday, March 21, 2011 10:18 PM
Hi,
Since I used FilterClause, delete statement won't apply to the synchronized database. By looking to the xxx_selectchanges statement, I don't understand why the query applies the filterclause to the select, the corresponding entry is deleted...
Here is the filterclause :
- lTable.AddFilterColumn("NO_SYNCHRO");
- lTable.FilterClause = "[base].[NO_SYNCHRO] = 0"
Here is the select statement of selectchanges stored procedre :
SELECT
... FROM[TABLE]
[base]RIGHT
JOIN [TABLE_tracking] [side] ON [base].[ENT_ID] = [side].[ENT_ID]WHERE
(
([base].[NO_SYNCHRO] = 0) OR
(
[side].[sync_row_is_tombstone] = 1 AND ([side].[update_scope_local_id] = @sync_scope_local_id OR
[side].[update_scope_local_id] IS NULL)AND [side].[NO_SYNCHRO] IS NULL
)
)
AND
(
[side].[update_scope_local_id] IS NULL OR [side].[update_scope_local_id] <> @sync_scope_local_id OR
([side].[update_scope_local_id] = @sync_scope_local_id AND [side].[scope_update_peer_key] <>@sync_update_peer_key
))
AND [side].[local_update_peer_timestamp] >@sync_min_timestamp
END
As you can see, the where clause use the filter on NO_SYNCHRO column.
Did I write a wrong filterclause ?
Thank you.
Regards. David
All Replies
-
Monday, March 21, 2011 11:21 PMModerator
try the filter on the tracking table instead:
e.g. able.FilterClause = "[side].[NO_SYNCHRO] = 0"
you're filtering on the base table, if the row has been deleted, then its no longer in the table and thus there is nothing to filter.
- Marked As Answer by David Chanussot Thursday, March 24, 2011 10:04 PM
-
Thursday, March 24, 2011 10:04 PM
Hi JuneT,
Great solution, works fine !
Thank a lot :)