NetBase SQL Shadowing Handbook

NetBase SQL User Exits
____________________________________________________________
ver A0195 QUEST Software, Inc. 3-13
Sample User Exit
The following sample user exit performs three functions:
1. It disables shadowing for the table named "LOCAL_TABLE".
2. Sets the WSL flag "KEY_COL_SEARCH_OK" on each update applied.
3. Prints a message to the console when the "CUST_NUM" column in the
"CUSTOMERS" table is updated.
Your user exit could write a record to the DBE. If it does, that table should be excluded from
shadowing.
#pragma list off
#define _MPEXL_SOURCE
#pragma intrinsic PRINT, PRINTOP
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <mpe.h>
#define byte unsigned char
#define MAX_COM_FLAGS 16
typedef struct {
int action;
int status;
int error1;
int error2;
int orignode;
int shadnode;
union { /* 16 bytes of flags */
byte all[MAX_COM_FLAGS];
struct {
byte first_time;
byte key_col_search;
} id;
} flags;
int user_area[512];
} comarea_rec;
typedef struct { /* column array record */
short column_type;
short column_length;
} col_rec;
typedef struct { /* update column record */
short upd_col_num;
short upd_col_type;
short upd_col_length;
} upd_rec;