NetBase SQL Shadowing Handbook

User Exits NetBase SQL
____________________________________________________________
3-16 QUEST Software, Inc. ver A0195
EXEC SQL BEGIN DECLARE SECTION;
char SQLMsg[130];
EXEC SQL END DECLARE SECTION;
comarea->action = 0;
/* IF IT'S NOT AN ERROR, RETURN */
if (sqlca.sqlcode >= 0) /* Not an error */
return;
/* PRINT OUT ALL THE ERROR MESSAGES ASSOCIATED WITH THIS ERROR */
/* IF THE ERROR OCCURED ON AN INSERT, UPDATE OR DELETE THEN CHECK */
/* THAT IT IS NOT AN INVALID TABLE */
do { /* Print the error */
EXEC SQL SQLEXPLAIN :SQLMsg;
PRINT (SQLMsg, -strlen(SQLMsg), 0);
PRINTOP (SQLMsg, -strlen(SQLMsg), 0);
} while (sqlca.sqlcode != 0);
if (header->record_type >= 24 && /* INSERT, UPDATE, OR DELETE */
header->record_type <= 26) {
if (header->record_type == 24)
strcpy (SQLMsg, "INSERT ");
else if (header->record_type == 25)
strcpy (SQLMsg, "DELETE ");
else if (header->record_type == 26)
strcpy (SQLMsg, "UPDATE ");
strcpy (SQLMsg+7, "error occured on table ");
memcpy (SQLMsg+30, header->table_name, 20);
SQLMsg[50] = '\0';
PRINT (SQLMsg, -strlen(SQLMsg), 0);
PRINTOP (SQLMsg, -strlen(SQLMsg), 0);
if (strncmp (header->table_name, "LOCAL_TABLE ", 12) == 0)
comarea->action = 4; /* this table is disabled !!! */
}
else { /* BEGIN OR COMMIT RECORD */
if (header->record_type == 1)
strcpy (SQLMsg, "Error occured on COMMIT record");
else
strcpy (SQLMsg, "Error occured on BEGIN record");
PRINT (SQLMsg, -strlen(SQLMsg), 0);
PRINTOP (SQLMsg, -strlen(SQLMsg), 0);
}
} /* end post_sql_exit_after */