Programming Guide


Install a C DBi event hook function

int dm_set_onevent(char *handler);

The name of the DBi event handler. If handler is 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.



handler is called after the DBMS ONEXIT function is or would be called. The prototype of this function is:

void handler(char *command, char *args, char *sql,
int elapsed_time);

This function is passed the following parameters:

A string containing the DBi command, for example "ALIAS" for the DBMS ALIAS command.

The argument passed to the DBMS command. It is same as the value that would be returned by the dm_getdbitext function.

If the DBMS statement 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.

This is the elapsed time for the DBMS command in milliseconds. It may be zero for commands like DBMS ALIAS that do not require any database interactions.