CREATE TABLESPACE DMD MANAGED BY AUTOMATIC STORAGE~
CREATE TABLE MWLOG.DLOG_MD (
	TYPE VARCHAR(256) NOT NULL,
	CODEX VARCHAR(256),
	PCORRELATIONID VARCHAR(1024),
	PSOURCE VARCHAR(1024),
	PCODE VARCHAR(1024),
	PBASE VARCHAR(1024),
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	C_1 VARCHAR(64),
	P_1 VARCHAR(256),
	C_2 VARCHAR(64),
	P_2 VARCHAR(256),
	C_3 VARCHAR(64),
	P_3 VARCHAR(256),
	C_4 VARCHAR(64),
	P_4 VARCHAR(256),
	C_5 VARCHAR(64),
	P_5 VARCHAR(256),
	C_6 VARCHAR(64),
	P_6 VARCHAR(256),
	C_7 VARCHAR(64),
	P_7 VARCHAR(256),
	C_8 VARCHAR(64),
	P_8 VARCHAR(256),
	C_9 VARCHAR(64),
	P_9 VARCHAR(256),
	C_10 VARCHAR(64),
	P_10 VARCHAR(256),
	C_11 VARCHAR(64),
	P_11 VARCHAR(256),
	C_12 VARCHAR(64),
	P_12 VARCHAR(256),
	C_13 VARCHAR(64),
	P_13 VARCHAR(256),
	C_14 VARCHAR(64),
	P_14 VARCHAR(256),
	C_15 VARCHAR(64),
	P_15 VARCHAR(256),
	C_16 VARCHAR(64),
	P_16 VARCHAR(256),
	C_17 VARCHAR(64),
	P_17 VARCHAR(256),
	C_18 VARCHAR(64),
	P_18 VARCHAR(256),
	C_19 VARCHAR(64),
	P_19 VARCHAR(256),
	C_20 VARCHAR(64),
	P_20 VARCHAR(256),
	C_21 VARCHAR(64),
	P_21 VARCHAR(256),
	C_22 VARCHAR(64),
	P_22 VARCHAR(256),
	C_23 VARCHAR(64),
	P_23 VARCHAR(256),
	C_24 VARCHAR(64),
	P_24 VARCHAR(256),
	C_25 VARCHAR(64),
	P_25 VARCHAR(256),
	C_26 VARCHAR(64),
	P_26 VARCHAR(256),
	C_27 VARCHAR(64),
	P_27 VARCHAR(256),
	C_28 VARCHAR(64),
	P_28 VARCHAR(256),
	C_29 VARCHAR(64),
	P_29 VARCHAR(256),
	C_30 VARCHAR(64),
	P_30 VARCHAR(256),
	C_31 VARCHAR(64),
	P_31 VARCHAR(256),
	C_32 VARCHAR(64),
	P_32 VARCHAR(256),
	C_33 VARCHAR(64),
	P_33 VARCHAR(256),
	C_34 VARCHAR(64),
	P_34 VARCHAR(256),
	C_35 VARCHAR(64),
	P_35 VARCHAR(256),
	C_36 VARCHAR(64),
	P_36 VARCHAR(256),
	C_37 VARCHAR(64),
	P_37 VARCHAR(256),
	C_38 VARCHAR(64),
	P_38 VARCHAR(256),
	C_39 VARCHAR(64),
	P_39 VARCHAR(256),
	C_40 VARCHAR(64),
	P_40 VARCHAR(256),
	CONSTRAINT PK_TYPE PRIMARY KEY(TYPE)
) IN DMD~

CREATE TABLESPACE LAY MANAGED BY AUTOMATIC STORAGE~
CREATE TABLE MWLOG.LOG_ACTIVITY (
	ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 NO CYCLE NO CACHE),
	USER VARCHAR(64) NOT NULL,
	ACTIVITY_DATE TIMESTAMP NOT NULL,
	IP VARCHAR(32) NOT NULL,
	BEFORE BLOB(1048576) LOGGED NOT COMPACT,
	AFTER BLOB(1048576) LOGGED NOT COMPACT,
	DESC VARCHAR(255) NOT NULL,
	TYPE VARCHAR(50) NOT NULL,
	BILLER VARCHAR(255),
	NAME VARCHAR(255),
	FROM_APP VARCHAR(255),
	CONSTRAINT PK_ID PRIMARY KEY (ID)
) IN LAY~

CREATE TABLESPACE LAH MANAGED BY AUTOMATIC STORAGE~
CREATE TABLE MWLOG.LOG_ACTIVITYH (
	ID BIGINT NOT NULL,
	USER VARCHAR(64) NOT NULL,
	ACTIVITY_DATE TIMESTAMP NOT NULL,
	IP VARCHAR(32) NOT NULL,
	BEFORE BLOB(1048576) LOGGED NOT COMPACT,
	AFTER BLOB(1048576) LOGGED NOT COMPACT,
	DESC VARCHAR(255) NOT NULL,
	TYPE VARCHAR(50) NOT NULL,
	BILLER VARCHAR(255),
	NAME VARCHAR(255),
	FROM_APP VARCHAR(255),
	CONSTRAINT PK_ID PRIMARY KEY (ID)
) IN LAH~

CREATE TABLESPACE CORE_RES MANAGED BY AUTOMATIC STORAGE~
CREATE TABLE MWLOG.DLOG_CORE_RES (
	CODE VARCHAR(35) NOT NULL,
	DATELOCAL VARCHAR(10) NOT NULL,
	RRN VARCHAR(15) NOT NULL,
	TIMELOCALTRANSACTION VARCHAR(10) NOT NULL,
		CONSTRAINT PK_TYPE PRIMARY KEY(RRN)
) IN CORE_RES~

CREATE TABLESPACE DLG MANAGED BY AUTOMATIC STORAGE~
CREATE TABLE MWLOG.DLOG (
	ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH +1 INCREMENT BY +1 MINVALUE +1 MAXVALUE +9223372036854775807 NO CYCLE NO CACHE NO ORDER),
	TYPE VARCHAR(256) NOT NULL,
	DIR CHAR(1) NOT NULL,
	TIMESTAMP TIMESTAMP,
	REQTIMESTAMP TIMESTAMP,
	CORELLATIONID VARCHAR(64),
	SOURCE VARCHAR(128),
	CODE VARCHAR(128),
	V_1 VARCHAR(20),
	V_2 VARCHAR(20),
	V_3 VARCHAR(20),
	V_4 VARCHAR(20),
	V_5 VARCHAR(20),
	V_6 VARCHAR(20),
	V_7 VARCHAR(20),
	V_8 VARCHAR(20),
	V_9 VARCHAR(20),
	V_10 VARCHAR(20),
	V_11 VARCHAR(100),
	V_12 VARCHAR(100),
	V_13 VARCHAR(100),
	V_14 VARCHAR(100),
	V_15 VARCHAR(100),
	V_16 VARCHAR(100),
	V_17 VARCHAR(100),
	V_18 VARCHAR(100),
	V_19 VARCHAR(100),
	V_20 VARCHAR(100),
	V_21 VARCHAR(100),
	V_22 VARCHAR(100),
	V_23 VARCHAR(100),
	V_24 VARCHAR(100),
	V_25 VARCHAR(100),
	V_26 VARCHAR(100),
	V_27 VARCHAR(100),
	V_28 VARCHAR(100),
	V_29 VARCHAR(100),
	V_30 VARCHAR(100),
	V_31 VARCHAR(100),
	V_32 VARCHAR(100),
	V_33 VARCHAR(100),
	V_34 VARCHAR(100),
	V_35 VARCHAR(100),
	V_36 VARCHAR(100),
	V_37 VARCHAR(100),
	V_38 VARCHAR(100),
	V_39 VARCHAR(250),
	V_40 VARCHAR(650),
	RAW BLOB(1048576) NOT LOGGED COMPACT,
	CONSTRAINT PK_ID PRIMARY KEY(ID),
	CONSTRAINT FK_DLOGMD_KEY FOREIGN KEY(TYPE) REFERENCES MWLOG.DLOG_MD(TYPE)
) IN DLG~