How do i delete the rows on the handheld upon sync. Do i have to delete all the rows of table after sync manually or is there any API for Ultralight database that does for me.

asked 09 Dec '11, 12:50

TEJ's gravatar image

accept rate: 0%

edited 09 Dec '11, 14:05

Jeff%20Albion's gravatar image

Jeff Albion

To start, it should be noted that you do not have to delete the remote rows from the device if you do not wish. UltraLite will use row-state markers to track which specific rows have changed in between synchronizations and will only attempt to upload those specific rows during the next synchronization session.

If you do wish to delete the rows as part of the synchronization download transaction, the mechanism to do this is the 'download_delete_cursor' table event on the MobiLink server. The idea behind this script is that you SELECT a set of primary keys to be sent back down to the remote for records that you wish to delete - the remote will then run those deletions as part of the download events on the remote. Part of developing this deletion mechanism is to figure out how to flag deletions from the consolidated database - this is typically done either through row-state markers on the table ("logical deletes") or by maintaining a separate table of keys to select from ("shadow delete"). Developing such a mechanism is discussed in greater detail in the documentation.

There are also options on how to specify how to handle deletes from the MobiLink Synchronization Model view.

Otherwise, you always have the regular UltraLite APIs that could be used from your client application to synchronize the UltraLite database, connect to the database afterwards, and perform your deletions manually.

permanent link

answered 09 Dec '11, 13:58

Jeff%20Albion's gravatar image

Jeff Albion
accept rate: 24%

edited 09 Dec '11, 13:59


Note that if you delete the UltraLite rows using a DELETE statement (directly on the UltraLite database), they will be uploaded as deletes on the next synchronization. If you don't want this and just want the UltraLite rows to go away and be forgotten, you use "STOP SYNCHRONIZATION DELETE" before you do the deletes, and "START SYNCHRONIZATION DELETE" after. The TRUNCATE TABLE statement implicitly runs in stop-sync-delete mode.

(09 Dec '11, 15:38) Tim McClements
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 09 Dec '11, 12:50

question was seen: 681 times

last updated: 09 Dec '11, 15:38