3

"SQLITE_ENABLE_UPDATE_DELETE_LIMIT" is a option of SQLite. People will compile their own SQLite and add this parameter to make the SQLite database support SQL Command "Limit" function.

But, how can I enable this option in the Android? I have to create the function to limit the update and delete function for the SQLite database access in Android Apps. And I cannot find any solution about this.

If I write the SQL command with "limit", it will return Syntax error for me. If I remove the "limit", that makes the update and delete function becomes not safety.

Fenix Lam
  • 386
  • 6
  • 22
  • delete & limit combined: http://stackoverflow.com/a/9800582/995891 - should work with update as well. – zapl Jul 22 '13 at 13:39

1 Answers1

5

how can I enable this option in the Android?

You compile your own SQLite using the NDK and add this parameter to make the SQLite database support LIMIT on UPDATE and DELETE statements. Then, you write your own set of wrapper classes to access your custom SQLite library.

This will be very complex; it will be far simpler for you to find some other solution to whatever problem you are trying to solve by using LIMIT in this fashion.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 7
    Just out of curiosity, why wasn't this enabled? Seems like the easiest way to throttle updates and deletes, and the need to throttle seems likely in mobile apps. – William T. Mallard Jan 19 '14 at 19:10