NetBase SQL Shadowing Handbook

User Exits NetBase SQL
____________________________________________________________
3-30 QUEST Software, Inc. ver A0195
/* CREATE THE MPE FILE STOP<SOURCE>.PUB.NETBASE */
strcpy (fname, "STOP");
for (i = 0; i < 4 && log_source[i] != ' '; i++);
memcpy (fname+4, log_source, i);
fname[i+4] = CHR0;
strcat (fname, ".PUB.NETBASE ");
i = FOPEN (fname, 0);
if (ccode() != CCE) { /* Open of the file failed */
FCHECK (i, &err);
sprintf (msg, "Error %d opening file %s", err, fname);
PRINT (msg, -strlen(msg), 0);
}
else { /* Open succeeded, close perm */
FCLOSE (i, 1, 0);
if (ccode() != CCE) { /* Close failed */
FCHECK (i, &err);
if (err != 100) { /* Duplicate permanent file */
sprintf (msg, "Error %d creating file %s", err, fname);
PRINT (msg, -strlen(msg), 0);
}
else {
sprintf (msg, "Cannot create %s, file already exists",
fname);
PRINT (msg, -strlen(msg), 0);
}
}
}
} /* end of if select record found */
} /* end export_sql_exit */
/* post_sql_exit_qfter */
/* */
/* Print out the type of record and call SQLEXPLAIN for all */
/* errors. If the record is an UPDATE, INSERT or DELETE, */
/* format and print out hte data. . */
/* */
void post_sql_exit_after (sqlca_type sqlca, comarea_rec *comarea,
header_rec *header, char *data, char *upd_data)
{
EXEC SQL BEGIN DECLARE SECTION;
int numColumns;
EXEC SQL END DECLARE SECTION;
int l, i, mlen;
int col;
char msg[90];
int offset;
int haveVAR = FALSE;
comarea->action = 0;