![]() | Programming Guide | ![]() |
Install a C DBi event hook function
int dm_set_onevent(char *handler);
handler- The name of the DBi event handler. If
handleris the null pointer or the null string, the DBi event handler is uninstalled. Otherwise, it must be the name of a C function installed in the prototyped function list.
- 0 The DBi event hook function was installed or uninstalled.
- -1
handleris not in the list of installed prototyped C functions.
handler is called after the DBMS ONEXIT function is or would be called. The prototype of this function is:
voidhandler(char*command, char*args, char*sql,intelapsed_time);This function is passed the following parameters:
command- A string containing the DBi command, for example
"ALIAS"for the DBMS ALIAS command.arg- The argument passed to the
DBMScommand. It is same as the value that would be returned by the dm_getdbitext function.sql- If the
DBMSstatement includes the WITH CURSOR clause, this value is the text of the SQL that was in the DBMS DECLARE CURSOR statement that created the cursor. Otherwise it is the null pointer.elapsed_time- This is the elapsed time for the
DBMScommand in milliseconds. It may be zero for commands like DBMS ALIAS that do not require any database interactions.
![]()
![]()
![]()
![]()