NetBase SQL Shadowing Handbook

User Exits NetBase SQL
____________________________________________________________
3-22 QUEST Software, Inc. ver A0195
A sample user exit for batch update shadowing which alerts the shadow system that "all"
transactions have been processed by creating a "STOP" MPE file. In addition, the user
exit explains with which transaction it struggled to update the shadow copy (if any).
#pragma list off
#define _MPEXL_SOURCE
#pragma intrinsic FOPEN, FCHECK, FCLOSE, PRINT
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <mpe.h>
#define TRUE 1
#define FALSE 0
#define CHR0 '\0'
#define CCE 2
#define BEGIN 1
#define COMMIT 15
#define INSERT 24
#define DELETE 25
#define UPDATE 26
#define DATE 10
#define TIME 11
#define DATETIME 12
#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;