[sqlite] sqlite3_update_hook() clarification

2016-03-09 Thread Sairam Gaddam
Thank you very much!!
It helped a lot.

On Wed, Mar 9, 2016 at 9:26 PM, Clemens Ladisch  wrote:

> Sairam Gaddam wrote:
> > The documentation says that the function sqlite3_update_hook() is called
> > whenever a row is updated, deleted or inserted
>
> No.  It says that this function is called to register a callback
> function that is called for these updates.
>
> > And I don't find any definition for this callback routine.
>
> void my_little_callback(void *stuff, int op, const char *db, const char
> *table, sqlite_int64 rowid)
> {
> printf("something was updated\n");
> }
>
> int main()
> {
> ...
> sqlite3_update_hook(db, my_little_callback, NULL);
> ...
> }
>
>
> Regards,
> Clemens
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


[sqlite] sqlite3_update_hook() clarification

2016-03-09 Thread Sairam Gaddam
http://www.sqlite.org/c3ref/update_hook.html

The documentation says that the function sqlite3_update_hook() is called
whenever a row is updated, deleted or inserted for a rowid table. But I
don't find this function to be invoked in my program. When will this
function be invoked??
And I am interested in its second parameter which gives the details of
table and the rowid of row which is updated. It is a callback function.

SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
  sqlite3 *db,  /* Attach the hook to this database */
  void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
  void *pArg/* Argument to the function */
)

And I don't find any definition for this callback routine.

Can anyone kindly give information on this?


[sqlite] sqlite3_update_hook() clarification

2016-03-09 Thread Clemens Ladisch
Sairam Gaddam wrote:
> The documentation says that the function sqlite3_update_hook() is called
> whenever a row is updated, deleted or inserted

No.  It says that this function is called to register a callback
function that is called for these updates.

> And I don't find any definition for this callback routine.

void my_little_callback(void *stuff, int op, const char *db, const char *table, 
sqlite_int64 rowid)
{
printf("something was updated\n");
}

int main()
{
...
sqlite3_update_hook(db, my_little_callback, NULL);
...
}


Regards,
Clemens