Programming Guide |
Gets the text of the last-executed DBMS command
#include <dmuproto.h>char *dm_getdbitext(void);
C only
- A pointer to the last-executed database command.
dm_getdbitext
lets you get the full text of the last-executedDBMS
command. This includes all commands executed from JPL with dbms, or executed from C with dm_dbms or dm_dbms_noexp.You must call this function from within an installed entry, error, or exit handler. This function stores the data in a pool of buffers that it shares with other functions, so you must either process the returned string immediately or copy it to another variable for additional processing.
This function gets the same string that is passed to the first argument of an installed entry, error, or exit handler; however, these handlers are limited to 255 characters.
int
logfunc PARMS((stmt, engine, flag))
PARM (char *stmt)
PARM (char *engine)
LASTPARM(int flag)
{
FILE *fp;
if (strlen(stmt) >= 255)
stmt = dm_getdbitext();
fp = fopen("dbi.log", "a");
fprintf(fp, "%s\n", stmt);
fclose(fp);
return 0;
}