The updateHookCallBack method is an example of a user callback method for the updateHook method. Here the method name of updateHookCallBack is used, because it is the default method name if the programmer does not specify his own name in the updateHook method. Any method name can be used by specifying it as the second argument to the updateHook method.
Note: there is no updateHookCallBack method in any ooSQLite class. This method is just used to illustrate how to define a user callback method to be used with the update hook.
Arguments: | The arguments sent to the callback method are:
|
Return value: | The programmer must return a whole number value from the callback. However, the actual value returned makes no difference to the SQLite database engine. Typically, the programmer would just return 0. |
Remarks: | The callback method must not do anything that will modify the database connection that invoked the callback. Any actions to modify the database connection must be deferred until after the completion of the step invocation that triggered the update hook to begin with. Running any other SQL statements, including SELECT statements, or merely instantiating a new new (Class method) object, or executing anotherstepmethod will modify the database connection. The update hook is not invoked when internal SQLite system tables are modified (i.e. sqlite_master and sqlite_sequence). In the current SQLite database enginge implementation, the update hook is not invoked when duplicate rows are deleted because of an ON CONFLICT REPLACE clause. Nor is the update hook invoked when rows are deleted using the truncate optimization. The exceptions defined in this paragraph might change in a future release of SQLite. |
Details: | The implementation of aupdate hookmethod is is discussed on the SQLite sqlite3_update_hook page. |