ALTER TABLE SDSADM.STD_ZIPTOMSAHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPTOMSAHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPTOMSAHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPTOMSAHISTORY ON SDSADM.STD_ZIPTOMSAHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipToMSAHistory
after DELETE
ON SDSADM.STD_ZIPTOMSAHISTORY
BEGIN
	-- update the table for STD_ZipToMSAHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipToMSAHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipToMSAHistory
after INSERT
ON SDSADM.STD_ZIPTOMSAHISTORY
BEGIN
	-- update the table for STD_ZipToMSAHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipToMSAHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipToMSAHistory
after UPDATE
ON SDSADM.STD_ZIPTOMSAHISTORY
BEGIN
	-- update the table for STD_ZipToMSAHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipToMSAHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPTOMSAHISTORY FOR SDSADM.STD_ZIPTOMSAHISTORY;


ALTER TABLE SDSADM.STD_ZIPTOMSAHISTORY ADD (
  CONSTRAINT PK_STD_ZIPTOMSAHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPTOMSAHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ZIPTOMSAHISTORY ADD (
  CONSTRAINT FKSTD_ZIPTOMSAHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ZIPTOMSA (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPTOMSAHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPTOMSAHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPTOMSAHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPTOMSAHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPTOMSAHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPTOMSAHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPTOMSAHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPTOMSAHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPTOMSAHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPTOMSA
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPTOMSA CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPTOMSA
(
  ID               NUMBER(20)                   NOT NULL,
  ZIPCODE          CHAR(5 BYTE)                 NOT NULL,
  MSACODEFROM1990  VARCHAR2(4 BYTE)             NOT NULL,
  VERSION          INTEGER                      NOT NULL,
  CREATED          TIMESTAMP(6)                 NOT NULL,
  UPDATED          TIMESTAMP(6),
  CREATEDBY        VARCHAR2(32 BYTE)            NOT NULL,
  UPDATEDBY        VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPTOMSA ON SDSADM.STD_ZIPTOMSA
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ZIPTOMSAZIPCODE ON SDSADM.STD_ZIPTOMSA
(ZIPCODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipToMSA
after DELETE
ON SDSADM.STD_ZIPTOMSA
BEGIN
	-- update the table for STD_ZipToMSA operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipToMSA';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipToMSA
after INSERT
ON SDSADM.STD_ZIPTOMSA
BEGIN
	-- update the table for STD_ZipToMSA operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipToMSA';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipToMSA
after UPDATE
ON SDSADM.STD_ZIPTOMSA
BEGIN
	-- update the table for STD_ZipToMSA operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipToMSA';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPTOMSA FOR SDSADM.STD_ZIPTOMSA;


ALTER TABLE SDSADM.STD_ZIPTOMSA ADD (
  CONSTRAINT PK_STD_ZIPTOMSA
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPTOMSA
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ZIPTOMSAZIPCODE
  UNIQUE (ZIPCODE)
  USING INDEX SDSADM.UQSTD_ZIPTOMSAZIPCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPTOMSA TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPTOMSA TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPTOMSA TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPTOMSA TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPTOMSA TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPTOMSA TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPTOMSA TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPTOMSA TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPTOMSA TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPPLACEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPPLACEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPPLACEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPPLACEHISTORY ON SDSADM.STD_ZIPPLACEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipPlaceHistory
after DELETE
ON SDSADM.STD_ZIPPLACEHISTORY
BEGIN
	-- update the table for STD_ZipPlaceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlaceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipPlaceHistory
after INSERT
ON SDSADM.STD_ZIPPLACEHISTORY
BEGIN
	-- update the table for STD_ZipPlaceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlaceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipPlaceHistory
after UPDATE
ON SDSADM.STD_ZIPPLACEHISTORY
BEGIN
	-- update the table for STD_ZipPlaceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlaceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPPLACEHISTORY FOR SDSADM.STD_ZIPPLACEHISTORY;


ALTER TABLE SDSADM.STD_ZIPPLACEHISTORY ADD (
  CONSTRAINT PK_STD_ZIPPLACEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPPLACEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ZIPPLACEHISTORY ADD (
  CONSTRAINT FKSTD_ZIPPLACEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ZIPPLACE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPPLACEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPPLACEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPPLACEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPPLACEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPPLACEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPPLACEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPPLACEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPPLACEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPPLACEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPPLACEFACILITYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPPLACEFACILITYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPPLACEFACILITYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPPLACEFACILITYHISTORY ON SDSADM.STD_ZIPPLACEFACILITYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipPlaceFacilityHstry
after DELETE
ON SDSADM.STD_ZIPPLACEFACILITYHISTORY
BEGIN
	-- update the table for STD_ZipPlaceFacilityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlaceFacilityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipPlaceFacilityHstry
after INSERT
ON SDSADM.STD_ZIPPLACEFACILITYHISTORY
BEGIN
	-- update the table for STD_ZipPlaceFacilityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlaceFacilityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipPlaceFacilityHstry
after UPDATE
ON SDSADM.STD_ZIPPLACEFACILITYHISTORY
BEGIN
	-- update the table for STD_ZipPlaceFacilityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlaceFacilityHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPPLACEFACILITYHISTORY FOR SDSADM.STD_ZIPPLACEFACILITYHISTORY;


ALTER TABLE SDSADM.STD_ZIPPLACEFACILITYHISTORY ADD (
  CONSTRAINT PK_STD_ZIPPLACEFACILITYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPPLACEFACILITYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ZIPPLACEFACILITYHISTORY ADD (
  CONSTRAINT FKSTD_ZIPPLACEFCLTYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ZIPPLACEFACILITY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPPLACEFACILITYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPPLACEFACILITYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPPLACEFACILITYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPPLACEFACILITY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPPLACEFACILITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPPLACEFACILITY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(75 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPPLACEFACILITY ON SDSADM.STD_ZIPPLACEFACILITY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ZIPPLACEFACILITYCODE ON SDSADM.STD_ZIPPLACEFACILITY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ZIPPLACEFACILITYNAME ON SDSADM.STD_ZIPPLACEFACILITY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipPlaceFacility
after DELETE
ON SDSADM.STD_ZIPPLACEFACILITY
BEGIN
	-- update the table for STD_ZipPlaceFacility operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlaceFacility';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipPlaceFacility
after INSERT
ON SDSADM.STD_ZIPPLACEFACILITY
BEGIN
	-- update the table for STD_ZipPlaceFacility operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlaceFacility';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipPlaceFacility
after UPDATE
ON SDSADM.STD_ZIPPLACEFACILITY
BEGIN
	-- update the table for STD_ZipPlaceFacility operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlaceFacility';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPPLACEFACILITY FOR SDSADM.STD_ZIPPLACEFACILITY;


ALTER TABLE SDSADM.STD_ZIPPLACEFACILITY ADD (
  CONSTRAINT PK_STD_ZIPPLACEFACILITY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPPLACEFACILITY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ZIPPLACEFACILITYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ZIPPLACEFACILITYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ZIPPLACEFACILITYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ZIPPLACEFACILITYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPPLACEFACILITY TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITY TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPPLACEFACILITY TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPPLACEFACILITY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPPLACEFACILITY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPPLACE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPPLACE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPPLACE
(
  ID                     NUMBER(20)             NOT NULL,
  ZIPPLACEKEY            VARCHAR2(6 BYTE)       NOT NULL,
  NAME                   VARCHAR2(28 BYTE)      NOT NULL,
  ISAPPROVEDMAILINGNAME  CHAR(1 BYTE)           NOT NULL,
  ABBREVIATEDNAME        VARCHAR2(13 BYTE),
  ZIPPLACEFACILITY_ID    NUMBER(20),
  VERSION                INTEGER                NOT NULL,
  CREATED                TIMESTAMP(6)           NOT NULL,
  UPDATED                TIMESTAMP(6),
  CREATEDBY              VARCHAR2(32 BYTE)      NOT NULL,
  UPDATEDBY              VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPPLACE ON SDSADM.STD_ZIPPLACE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ZIPPLACEZIPPLACEKEY ON SDSADM.STD_ZIPPLACE
(ZIPPLACEKEY)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipPlace
after DELETE
ON SDSADM.STD_ZIPPLACE
BEGIN
	-- update the table for STD_ZipPlace operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlace';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipPlace
after INSERT
ON SDSADM.STD_ZIPPLACE
BEGIN
	-- update the table for STD_ZipPlace operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlace';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipPlace
after UPDATE
ON SDSADM.STD_ZIPPLACE
BEGIN
	-- update the table for STD_ZipPlace operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipPlace';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPPLACE FOR SDSADM.STD_ZIPPLACE;


ALTER TABLE SDSADM.STD_ZIPPLACE ADD (
  CONSTRAINT PK_STD_ZIPPLACE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPPLACE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ZIPPLACEZIPPLACEKEY
  UNIQUE (ZIPPLACEKEY)
  USING INDEX SDSADM.UQSTD_ZIPPLACEZIPPLACEKEY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ZIPPLACE ADD (
  CONSTRAINT FKSTD_ZIPPLACEZIPPLACEFACILITY 
  FOREIGN KEY (ZIPPLACEFACILITY_ID) 
  REFERENCES SDSADM.STD_ZIPPLACEFACILITY (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPPLACE TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPPLACE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPPLACE TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPPLACE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPPLACE TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPPLACE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPPLACE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPPLACE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPPLACE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPCODEHISTORY ON SDSADM.STD_ZIPCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipCodeHistory
after DELETE
ON SDSADM.STD_ZIPCODEHISTORY
BEGIN
	-- update the table for STD_ZipCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipCodeHistory
after INSERT
ON SDSADM.STD_ZIPCODEHISTORY
BEGIN
	-- update the table for STD_ZipCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipCodeHistory
after UPDATE
ON SDSADM.STD_ZIPCODEHISTORY
BEGIN
	-- update the table for STD_ZipCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPCODEHISTORY FOR SDSADM.STD_ZIPCODEHISTORY;


ALTER TABLE SDSADM.STD_ZIPCODEHISTORY ADD (
  CONSTRAINT PK_STD_ZIPCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ZIPCODEHISTORY ADD (
  CONSTRAINT FKSTD_ZIPCODEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ZIPCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPCODE
(
  ID                    NUMBER(20)              NOT NULL,
  ZIPCODE               VARCHAR2(10 BYTE)       NOT NULL,
  ZIPCLASSIFICATION_ID  NUMBER(20),
  PREFERREDZIPPLACE_ID  NUMBER(20),
  STATE_ID              NUMBER(20)              NOT NULL,
  COUNTYNUMBER          CHAR(3 BYTE),
  VERSION               INTEGER                 NOT NULL,
  CREATED               TIMESTAMP(6)            NOT NULL,
  UPDATED               TIMESTAMP(6),
  CREATEDBY             VARCHAR2(32 BYTE)       NOT NULL,
  UPDATEDBY             VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPCODE ON SDSADM.STD_ZIPCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ZIPCODEZIPCODE ON SDSADM.STD_ZIPCODE
(ZIPCODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipCode
after DELETE
ON SDSADM.STD_ZIPCODE
BEGIN
	-- update the table for STD_ZipCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipCode
after INSERT
ON SDSADM.STD_ZIPCODE
BEGIN
	-- update the table for STD_ZipCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipCode
after UPDATE
ON SDSADM.STD_ZIPCODE
BEGIN
	-- update the table for STD_ZipCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPCODE FOR SDSADM.STD_ZIPCODE;


ALTER TABLE SDSADM.STD_ZIPCODE ADD (
  CONSTRAINT PK_STD_ZIPCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ZIPCODEZIPCODE
  UNIQUE (ZIPCODE)
  USING INDEX SDSADM.UQSTD_ZIPCODEZIPCODE
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ZIPCODE ADD (
  CONSTRAINT FKSTD_ZIPCODEPREFERREDZIPPLACE 
  FOREIGN KEY (PREFERREDZIPPLACE_ID) 
  REFERENCES SDSADM.STD_ZIPPLACE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_ZIPCODESTATE 
  FOREIGN KEY (STATE_ID) 
  REFERENCES SDSADM.STD_STATE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_ZIPCODEZIPCLASSIFICATION 
  FOREIGN KEY (ZIPCLASSIFICATION_ID) 
  REFERENCES SDSADM.STD_ZIPCLASSIFICATION (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPCODE TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPCLASSIFICATIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPCLASSIFICATIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPCLASSIFICATIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPCLASSIFICATIONHSTRY ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipClssfctnHstry
after DELETE
ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY
BEGIN
	-- update the table for STD_ZipClassificationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipClassificationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipClssfctnHstry
after INSERT
ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY
BEGIN
	-- update the table for STD_ZipClassificationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipClassificationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipClssfctnHstry
after UPDATE
ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY
BEGIN
	-- update the table for STD_ZipClassificationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipClassificationHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPCLASSIFICATIONHISTORY FOR SDSADM.STD_ZIPCLASSIFICATIONHISTORY;


ALTER TABLE SDSADM.STD_ZIPCLASSIFICATIONHISTORY ADD (
  CONSTRAINT PK_STD_ZIPCLASSIFICATIONHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPCLASSIFICATIONHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ZIPCLASSIFICATIONHISTORY ADD (
  CONSTRAINT FKSTD_ZIPCLSSFCTNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ZIPCLASSIFICATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPCLASSIFICATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPCLASSIFICATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPCLASSIFICATION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(20 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(75 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPCLASSIFICATION ON SDSADM.STD_ZIPCLASSIFICATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ZIPCLASSIFICATIONCODE ON SDSADM.STD_ZIPCLASSIFICATION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ZIPCLASSIFICATIONNAME ON SDSADM.STD_ZIPCLASSIFICATION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipClassification
after DELETE
ON SDSADM.STD_ZIPCLASSIFICATION
BEGIN
	-- update the table for STD_ZipClassification operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipClassification';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipClassification
after INSERT
ON SDSADM.STD_ZIPCLASSIFICATION
BEGIN
	-- update the table for STD_ZipClassification operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipClassification';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipClassification
after UPDATE
ON SDSADM.STD_ZIPCLASSIFICATION
BEGIN
	-- update the table for STD_ZipClassification operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipClassification';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPCLASSIFICATION FOR SDSADM.STD_ZIPCLASSIFICATION;


ALTER TABLE SDSADM.STD_ZIPCLASSIFICATION ADD (
  CONSTRAINT PK_STD_ZIPCLASSIFICATION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ZIPCLASSIFICATION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ZIPCLASSIFICATIONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ZIPCLASSIFICATIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ZIPCLASSIFICATIONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ZIPCLASSIFICATIONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPCLASSIFICATION TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATION TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPCLASSIFICATION TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPCLASSIFICATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPCLASSIFICATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ZIPASSIGNMENT
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ZIPASSIGNMENT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ZIPASSIGNMENT
(
  ZIPCODE_ID   NUMBER(20)                       NOT NULL,
  ZIPPLACE_ID  NUMBER(20)                       NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ZIPASSIGNMENT ON SDSADM.STD_ZIPASSIGNMENT
(ZIPCODE_ID, ZIPPLACE_ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ZipAssignment
after DELETE
ON SDSADM.STD_ZIPASSIGNMENT
BEGIN
	-- update the table for STD_ZipAssignment operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipAssignment';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ZipAssignment
after INSERT
ON SDSADM.STD_ZIPASSIGNMENT
BEGIN
	-- update the table for STD_ZipAssignment operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipAssignment';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ZipAssignment
after UPDATE
ON SDSADM.STD_ZIPASSIGNMENT
BEGIN
	-- update the table for STD_ZipAssignment operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ZipAssignment';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ZIPASSIGNMENT FOR SDSADM.STD_ZIPASSIGNMENT;


ALTER TABLE SDSADM.STD_ZIPASSIGNMENT ADD (
  CONSTRAINT PK_STD_ZIPASSIGNMENT
  PRIMARY KEY
  (ZIPCODE_ID, ZIPPLACE_ID)
  USING INDEX SDSADM.PK_STD_ZIPASSIGNMENT
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ZIPASSIGNMENT ADD (
  CONSTRAINT FKSTD_ZIPASSIGNMENTZIPCODE 
  FOREIGN KEY (ZIPCODE_ID) 
  REFERENCES SDSADM.STD_ZIPCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_ZIPASSIGNMENTZIPPLACE 
  FOREIGN KEY (ZIPPLACE_ID) 
  REFERENCES SDSADM.STD_ZIPPLACE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ZIPASSIGNMENT TO ADR;

GRANT SELECT ON SDSADM.STD_ZIPASSIGNMENT TO ADREXT;

GRANT SELECT ON SDSADM.STD_ZIPASSIGNMENT TO EESRV;

GRANT SELECT ON SDSADM.STD_ZIPASSIGNMENT TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ZIPASSIGNMENT TO LOBR;

GRANT SELECT ON SDSADM.STD_ZIPASSIGNMENT TO PSIM;

GRANT DELETE, INSERT, SELECT, UPDATE ON SDSADM.STD_ZIPASSIGNMENT TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ZIPASSIGNMENT TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ZIPASSIGNMENT TO SDS_SELECT;
ALTER TABLE SDSADM.STD_YESNOCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_YESNOCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_YESNOCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_YESNOCODEHISTORY ON SDSADM.STD_YESNOCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_YesNoCodeHistory
after DELETE
ON SDSADM.STD_YESNOCODEHISTORY
BEGIN
	-- update the table for STD_YesNoCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_YesNoCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_YesNoCodeHistory
after INSERT
ON SDSADM.STD_YESNOCODEHISTORY
BEGIN
	-- update the table for STD_YesNoCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_YesNoCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_YesNoCodeHistory
after UPDATE
ON SDSADM.STD_YESNOCODEHISTORY
BEGIN
	-- update the table for STD_YesNoCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_YesNoCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_YESNOCODEHISTORY FOR SDSADM.STD_YESNOCODEHISTORY;


ALTER TABLE SDSADM.STD_YESNOCODEHISTORY ADD (
  CONSTRAINT PK_STD_YESNOCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_YESNOCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_YESNOCODEHISTORY ADD (
  CONSTRAINT FKSTD_YESNOCODEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_YESNOCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_YESNOCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_YESNOCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_YESNOCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_YESNOCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_YESNOCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_YESNOCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_YESNOCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_YESNOCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_YESNOCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_YESNOCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_YESNOCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_YESNOCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  ALPHACODE    VARCHAR2(1 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_YESNOCODE ON SDSADM.STD_YESNOCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_YESNOCODEALPHACODE ON SDSADM.STD_YESNOCODE
(ALPHACODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_YESNOCODECODE ON SDSADM.STD_YESNOCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_YESNOCODENAME ON SDSADM.STD_YESNOCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_YesNoCode
after DELETE
ON SDSADM.STD_YESNOCODE
BEGIN
	-- update the table for STD_YesNoCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_YesNoCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_YesNoCode
after INSERT
ON SDSADM.STD_YESNOCODE
BEGIN
	-- update the table for STD_YesNoCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_YesNoCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_YesNoCode
after UPDATE
ON SDSADM.STD_YESNOCODE
BEGIN
	-- update the table for STD_YesNoCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_YesNoCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_YESNOCODE FOR SDSADM.STD_YESNOCODE;


ALTER TABLE SDSADM.STD_YESNOCODE ADD (
  CONSTRAINT PK_STD_YESNOCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_YESNOCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_YESNOCODEALPHACODE
  UNIQUE (ALPHACODE)
  USING INDEX SDSADM.UQSTD_YESNOCODEALPHACODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_YESNOCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_YESNOCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_YESNOCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_YESNOCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_YESNOCODE TO ADR;

GRANT SELECT ON SDSADM.STD_YESNOCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_YESNOCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_YESNOCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_YESNOCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_YESNOCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_YESNOCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_YESNOCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_YESNOCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_VBAQUERYSTATUSTYPEHSTRY ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_VBAQuerySttsTypHstry
after DELETE
ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY
BEGIN
	-- update the table for STD_VBAQueryStatusTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_VBAQueryStatusTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_VBAQuerySttsTypHstry
after INSERT
ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY
BEGIN
	-- update the table for STD_VBAQueryStatusTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_VBAQueryStatusTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_VBAQuerySttsTypHstry
after UPDATE
ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY
BEGIN
	-- update the table for STD_VBAQueryStatusTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_VBAQueryStatusTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_VBAQUERYSTATUSTYPEHISTORY FOR SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY;


ALTER TABLE SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY ADD (
  CONSTRAINT PK_STD_VBAQUERYSTATUSTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_VBAQUERYSTATUSTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY ADD (
  CONSTRAINT FKSTD_VBAQUERYSTTSTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_VBAQUERYSTATUSTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_VBAQUERYSTATUSTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_VBAQUERYSTATUSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_VBAQUERYSTATUSTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(60 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_VBAQUERYSTATUSTYPE ON SDSADM.STD_VBAQUERYSTATUSTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_VBAQUERYSTATUSTYPECODE ON SDSADM.STD_VBAQUERYSTATUSTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_VBAQUERYSTATUSTYPENAME ON SDSADM.STD_VBAQUERYSTATUSTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_VBAQueryStatusType
after DELETE
ON SDSADM.STD_VBAQUERYSTATUSTYPE
BEGIN
	-- update the table for STD_VBAQueryStatusType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_VBAQueryStatusType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_VBAQueryStatusType
after INSERT
ON SDSADM.STD_VBAQUERYSTATUSTYPE
BEGIN
	-- update the table for STD_VBAQueryStatusType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_VBAQueryStatusType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_VBAQueryStatusType
after UPDATE
ON SDSADM.STD_VBAQUERYSTATUSTYPE
BEGIN
	-- update the table for STD_VBAQueryStatusType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_VBAQueryStatusType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_VBAQUERYSTATUSTYPE FOR SDSADM.STD_VBAQUERYSTATUSTYPE;


ALTER TABLE SDSADM.STD_VBAQUERYSTATUSTYPE ADD (
  CONSTRAINT PK_STD_VBAQUERYSTATUSTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_VBAQUERYSTATUSTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_VBAQUERYSTATUSTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_VBAQUERYSTATUSTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_VBAQUERYSTATUSTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_VBAQUERYSTATUSTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_VBAQUERYSTATUSTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_VBAQUERYSTATUSTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_VBAQUERYSTATUSTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_VBAQUERYSTATUSTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_USERGROUPTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_USERGROUPTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_USERGROUPTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_USERGROUPTYPEHISTORY ON SDSADM.STD_USERGROUPTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_UserGroupTypeHistory
after DELETE
ON SDSADM.STD_USERGROUPTYPEHISTORY
BEGIN
	-- update the table for STD_UserGroupTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_UserGroupTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_UserGroupTypeHistory
after INSERT
ON SDSADM.STD_USERGROUPTYPEHISTORY
BEGIN
	-- update the table for STD_UserGroupTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_UserGroupTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_UserGroupTypeHistory
after UPDATE
ON SDSADM.STD_USERGROUPTYPEHISTORY
BEGIN
	-- update the table for STD_UserGroupTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_UserGroupTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_USERGROUPTYPEHISTORY FOR SDSADM.STD_USERGROUPTYPEHISTORY;


ALTER TABLE SDSADM.STD_USERGROUPTYPEHISTORY ADD (
  CONSTRAINT PK_STD_USERGROUPTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_USERGROUPTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_USERGROUPTYPEHISTORY ADD (
  CONSTRAINT FKSTD_USERGROUPTYPEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_USERGROUPTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_USERGROUPTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_USERGROUPTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_USERGROUPTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_USERGROUPTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_USERGROUPTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_USERGROUPTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(40 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_USERGROUPTYPE ON SDSADM.STD_USERGROUPTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_USERGROUPTYPECODE ON SDSADM.STD_USERGROUPTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_USERGROUPTYPENAME ON SDSADM.STD_USERGROUPTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_UserGroupType
after DELETE
ON SDSADM.STD_USERGROUPTYPE
BEGIN
	-- update the table for STD_UserGroupType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_UserGroupType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_UserGroupType
after INSERT
ON SDSADM.STD_USERGROUPTYPE
BEGIN
	-- update the table for STD_UserGroupType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_UserGroupType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_UserGroupType
after UPDATE
ON SDSADM.STD_USERGROUPTYPE
BEGIN
	-- update the table for STD_UserGroupType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_UserGroupType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_USERGROUPTYPE FOR SDSADM.STD_USERGROUPTYPE;


ALTER TABLE SDSADM.STD_USERGROUPTYPE ADD (
  CONSTRAINT PK_STD_USERGROUPTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_USERGROUPTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_USERGROUPTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_USERGROUPTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_USERGROUPTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_USERGROUPTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_USERGROUPTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_USERGROUPTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_USERGROUPTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_USERGROUPTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_TRANSACTIONTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_TRANSACTIONTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_TRANSACTIONTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_TRANSACTIONTYPEHISTORY ON SDSADM.STD_TRANSACTIONTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_TransactionTypeHstry
after DELETE
ON SDSADM.STD_TRANSACTIONTYPEHISTORY
BEGIN
	-- update the table for STD_TransactionTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TransactionTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_TransactionTypeHstry
after INSERT
ON SDSADM.STD_TRANSACTIONTYPEHISTORY
BEGIN
	-- update the table for STD_TransactionTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TransactionTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_TransactionTypeHstry
after UPDATE
ON SDSADM.STD_TRANSACTIONTYPEHISTORY
BEGIN
	-- update the table for STD_TransactionTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TransactionTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_TRANSACTIONTYPEHISTORY FOR SDSADM.STD_TRANSACTIONTYPEHISTORY;


ALTER TABLE SDSADM.STD_TRANSACTIONTYPEHISTORY ADD (
  CONSTRAINT PK_STD_TRANSACTIONTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_TRANSACTIONTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_TRANSACTIONTYPEHISTORY ADD (
  CONSTRAINT FKSTD_TRANSACTIONTYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_TRANSACTIONTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_TRANSACTIONTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_TRANSACTIONTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_TRANSACTIONTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_TRANSACTIONTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_TRANSACTIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_TRANSACTIONTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_TRANSACTIONTYPE ON SDSADM.STD_TRANSACTIONTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_TRANSACTIONTYPECODE ON SDSADM.STD_TRANSACTIONTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_TRANSACTIONTYPENAME ON SDSADM.STD_TRANSACTIONTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_TransactionType
after DELETE
ON SDSADM.STD_TRANSACTIONTYPE
BEGIN
	-- update the table for STD_TransactionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TransactionType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_TransactionType
after INSERT
ON SDSADM.STD_TRANSACTIONTYPE
BEGIN
	-- update the table for STD_TransactionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TransactionType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_TransactionType
after UPDATE
ON SDSADM.STD_TRANSACTIONTYPE
BEGIN
	-- update the table for STD_TransactionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TransactionType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_TRANSACTIONTYPE FOR SDSADM.STD_TRANSACTIONTYPE;


ALTER TABLE SDSADM.STD_TRANSACTIONTYPE ADD (
  CONSTRAINT PK_STD_TRANSACTIONTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_TRANSACTIONTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_TRANSACTIONTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_TRANSACTIONTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_TRANSACTIONTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_TRANSACTIONTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_TRANSACTIONTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_TRANSACTIONTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_TRANSACTIONTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_TRANSACTIONTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_TERMINATIONREASONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_TERMINATIONREASONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_TERMINATIONREASONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_TERMINATIONREASONHSTRY ON SDSADM.STD_TERMINATIONREASONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_TerminationRsnHstry
after DELETE
ON SDSADM.STD_TERMINATIONREASONHISTORY
BEGIN
	-- update the table for STD_TerminationReasonHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TerminationReasonHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_TerminationRsnHstry
after INSERT
ON SDSADM.STD_TERMINATIONREASONHISTORY
BEGIN
	-- update the table for STD_TerminationReasonHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TerminationReasonHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_TerminationRsnHstry
after UPDATE
ON SDSADM.STD_TERMINATIONREASONHISTORY
BEGIN
	-- update the table for STD_TerminationReasonHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TerminationReasonHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_TERMINATIONREASONHISTORY FOR SDSADM.STD_TERMINATIONREASONHISTORY;


ALTER TABLE SDSADM.STD_TERMINATIONREASONHISTORY ADD (
  CONSTRAINT PK_STD_TERMINATIONREASONHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_TERMINATIONREASONHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_TERMINATIONREASONHISTORY ADD (
  CONSTRAINT FKSTD_TERMINATIONRSNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_TERMINATIONREASON (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_TERMINATIONREASONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_TERMINATIONREASONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_TERMINATIONREASONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_TERMINATIONREASON
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_TERMINATIONREASON CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_TERMINATIONREASON
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(8 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_TERMINATIONREASON ON SDSADM.STD_TERMINATIONREASON
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_TERMINATIONREASONCODE ON SDSADM.STD_TERMINATIONREASON
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_TERMINATIONREASONNAME ON SDSADM.STD_TERMINATIONREASON
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_TerminationReason
after DELETE
ON SDSADM.STD_TERMINATIONREASON
BEGIN
	-- update the table for STD_TerminationReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TerminationReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_TerminationReason
after INSERT
ON SDSADM.STD_TERMINATIONREASON
BEGIN
	-- update the table for STD_TerminationReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TerminationReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_TerminationReason
after UPDATE
ON SDSADM.STD_TERMINATIONREASON
BEGIN
	-- update the table for STD_TerminationReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_TerminationReason';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_TERMINATIONREASON FOR SDSADM.STD_TERMINATIONREASON;


ALTER TABLE SDSADM.STD_TERMINATIONREASON ADD (
  CONSTRAINT PK_STD_TERMINATIONREASON
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_TERMINATIONREASON
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_TERMINATIONREASONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_TERMINATIONREASONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_TERMINATIONREASONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_TERMINATIONREASONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_TERMINATIONREASON TO ADR;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASON TO ADREXT;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASON TO EESRV;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASON TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_TERMINATIONREASON TO LOBR;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASON TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_TERMINATIONREASON TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASON TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_TERMINATIONREASON TO SDS_SELECT;
ALTER TABLE SDSADM.STD_TABLEMANAGER
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_TABLEMANAGER CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_TABLEMANAGER
(
  ID             NUMBER(20)                     NOT NULL,
  TABLENAME      VARCHAR2(31 BYTE)              NOT NULL,
  RELEASENUMBER  VARCHAR2(5 BYTE)               NOT NULL,
  RELEASEDATE    VARCHAR2(15 BYTE),
  LASTPOPULATED  VARCHAR2(15 BYTE),
  LASTUPDATED    TIMESTAMP(6)                   NOT NULL
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_TABLEMANAGER ON SDSADM.STD_TABLEMANAGER
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_TABLEMANAGERTABLENAME ON SDSADM.STD_TABLEMANAGER
(TABLENAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE PUBLIC SYNONYM STD_TABLEMANAGER FOR SDSADM.STD_TABLEMANAGER;


ALTER TABLE SDSADM.STD_TABLEMANAGER ADD (
  CONSTRAINT PK_STD_TABLEMANAGER
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_TABLEMANAGER
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_TABLEMANAGERTABLENAME
  UNIQUE (TABLENAME)
  USING INDEX SDSADM.UQSTD_TABLEMANAGERTABLENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_TABLEMANAGER TO ADR;

GRANT SELECT ON SDSADM.STD_TABLEMANAGER TO ADREXT;

GRANT SELECT ON SDSADM.STD_TABLEMANAGER TO EESRV;

GRANT SELECT ON SDSADM.STD_TABLEMANAGER TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_TABLEMANAGER TO LOBR;

GRANT SELECT ON SDSADM.STD_TABLEMANAGER TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_TABLEMANAGER TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_TABLEMANAGER TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SVCDSCHRGCDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SVCDSCHRGCDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SVCDSCHRGCDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SVCDSCHRGCDHISTORY ON SDSADM.STD_SVCDSCHRGCDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SvcDschrgCdHistory
after DELETE
ON SDSADM.STD_SVCDSCHRGCDHISTORY
BEGIN
	-- update the table for STD_SvcDschrgCdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SvcDschrgCdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SvcDschrgCdHistory
after INSERT
ON SDSADM.STD_SVCDSCHRGCDHISTORY
BEGIN
	-- update the table for STD_SvcDschrgCdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SvcDschrgCdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SvcDschrgCdHistory
after UPDATE
ON SDSADM.STD_SVCDSCHRGCDHISTORY
BEGIN
	-- update the table for STD_SvcDschrgCdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SvcDschrgCdHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SVCDSCHRGCDHISTORY FOR SDSADM.STD_SVCDSCHRGCDHISTORY;


ALTER TABLE SDSADM.STD_SVCDSCHRGCDHISTORY ADD (
  CONSTRAINT PK_STD_SVCDSCHRGCDHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SVCDSCHRGCDHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SVCDSCHRGCDHISTORY ADD (
  CONSTRAINT FKSTD_SVCDSCHRGCDHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SERVICEDISCHARGECODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SVCDSCHRGCDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SVCDSCHRGCDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SVCDSCHRGCDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SVCDSCHRGCDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SVCDSCHRGCDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SVCDSCHRGCDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SVCDSCHRGCDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SVCDSCHRGCDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SVCDSCHRGCDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_STATISTICALAREATYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_STATISTICALAREATYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_STATISTICALAREATYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_STATISTICALAREATYPHSTRY ON SDSADM.STD_STATISTICALAREATYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_StatisticalArTypHstry
after DELETE
ON SDSADM.STD_STATISTICALAREATYPEHISTORY
BEGIN
	-- update the table for STD_StatisticalAreaTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalAreaTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_StatisticalArTypHstry
after INSERT
ON SDSADM.STD_STATISTICALAREATYPEHISTORY
BEGIN
	-- update the table for STD_StatisticalAreaTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalAreaTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_StatisticalArTypHstry
after UPDATE
ON SDSADM.STD_STATISTICALAREATYPEHISTORY
BEGIN
	-- update the table for STD_StatisticalAreaTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalAreaTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_STATISTICALAREATYPEHISTORY FOR SDSADM.STD_STATISTICALAREATYPEHISTORY;


ALTER TABLE SDSADM.STD_STATISTICALAREATYPEHISTORY ADD (
  CONSTRAINT PK_STD_STATISTICALAREATYPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_STATISTICALAREATYPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_STATISTICALAREATYPEHISTORY ADD (
  CONSTRAINT FKSTD_STTSTCLARTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_STATISTICALAREATYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_STATISTICALAREATYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_STATISTICALAREATYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_STATISTICALAREATYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_STATISTICALAREATYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_STATISTICALAREATYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_STATISTICALAREATYPE
(
  ID             NUMBER(20)                     NOT NULL,
  CODE           VARCHAR2(11 BYTE)              NOT NULL,
  NAME           VARCHAR2(45 BYTE)              NOT NULL,
  DESCRIPTION    VARCHAR2(60 BYTE),
  PARENTTYPE_ID  NUMBER(20),
  VERSION        INTEGER                        NOT NULL,
  CREATED        TIMESTAMP(6)                   NOT NULL,
  UPDATED        TIMESTAMP(6),
  CREATEDBY      VARCHAR2(32 BYTE)              NOT NULL,
  UPDATEDBY      VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_STATISTICALAREATYPE ON SDSADM.STD_STATISTICALAREATYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_STATISTICALAREATYPECODE ON SDSADM.STD_STATISTICALAREATYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_STATISTICALAREATYPENAME ON SDSADM.STD_STATISTICALAREATYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_StatisticalAreaType
after DELETE
ON SDSADM.STD_STATISTICALAREATYPE
BEGIN
	-- update the table for STD_StatisticalAreaType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalAreaType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_StatisticalAreaType
after INSERT
ON SDSADM.STD_STATISTICALAREATYPE
BEGIN
	-- update the table for STD_StatisticalAreaType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalAreaType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_StatisticalAreaType
after UPDATE
ON SDSADM.STD_STATISTICALAREATYPE
BEGIN
	-- update the table for STD_StatisticalAreaType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalAreaType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_STATISTICALAREATYPE FOR SDSADM.STD_STATISTICALAREATYPE;


ALTER TABLE SDSADM.STD_STATISTICALAREATYPE ADD (
  CONSTRAINT PK_STD_STATISTICALAREATYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_STATISTICALAREATYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_STATISTICALAREATYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_STATISTICALAREATYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_STATISTICALAREATYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_STATISTICALAREATYPENAME
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_STATISTICALAREATYPE ADD (
  CONSTRAINT FKSTD_STATISTICALARTYPPRNTTYP 
  FOREIGN KEY (PARENTTYPE_ID) 
  REFERENCES SDSADM.STD_STATISTICALAREATYPE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_STATISTICALAREATYPE TO ADR;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_STATISTICALAREATYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_STATISTICALAREATYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_STATISTICALAREATYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_STATISTICALAREAHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_STATISTICALAREAHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_STATISTICALAREAHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_STATISTICALAREAHISTORY ON SDSADM.STD_STATISTICALAREAHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_StatisticalAreaHstry
after DELETE
ON SDSADM.STD_STATISTICALAREAHISTORY
BEGIN
	-- update the table for STD_StatisticalAreaHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalAreaHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_StatisticalAreaHstry
after INSERT
ON SDSADM.STD_STATISTICALAREAHISTORY
BEGIN
	-- update the table for STD_StatisticalAreaHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalAreaHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_StatisticalAreaHstry
after UPDATE
ON SDSADM.STD_STATISTICALAREAHISTORY
BEGIN
	-- update the table for STD_StatisticalAreaHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalAreaHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_STATISTICALAREAHISTORY FOR SDSADM.STD_STATISTICALAREAHISTORY;


ALTER TABLE SDSADM.STD_STATISTICALAREAHISTORY ADD (
  CONSTRAINT PK_STD_STATISTICALAREAHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_STATISTICALAREAHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_STATISTICALAREAHISTORY ADD (
  CONSTRAINT FKSTD_STATISTICALAREAHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_STATISTICALAREA (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_STATISTICALAREAHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_STATISTICALAREAHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_STATISTICALAREAHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_STATISTICALAREAHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_STATISTICALAREAHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_STATISTICALAREAHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_STATISTICALAREAHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_STATISTICALAREAHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_STATISTICALAREAHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_STATISTICALAREA
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_STATISTICALAREA CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_STATISTICALAREA
(
  ID                      NUMBER(20)            NOT NULL,
  CODE                    NUMBER(10)            NOT NULL,
  TITLE                   VARCHAR2(100 BYTE)    NOT NULL,
  STATISTICALAREATYPE_ID  NUMBER(20)            NOT NULL,
  PARENT_ID               NUMBER(20),
  VERSION                 INTEGER               NOT NULL,
  CREATED                 TIMESTAMP(6)          NOT NULL,
  UPDATED                 TIMESTAMP(6),
  CREATEDBY               VARCHAR2(32 BYTE)     NOT NULL,
  UPDATEDBY               VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_STATISTICALAREA ON SDSADM.STD_STATISTICALAREA
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_STATISTICALAREACODE ON SDSADM.STD_STATISTICALAREA
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_StatisticalArea
after DELETE
ON SDSADM.STD_STATISTICALAREA
BEGIN
	-- update the table for STD_StatisticalArea operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalArea';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_StatisticalArea
after INSERT
ON SDSADM.STD_STATISTICALAREA
BEGIN
	-- update the table for STD_StatisticalArea operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalArea';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_StatisticalArea
after UPDATE
ON SDSADM.STD_STATISTICALAREA
BEGIN
	-- update the table for STD_StatisticalArea operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatisticalArea';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_STATISTICALAREA FOR SDSADM.STD_STATISTICALAREA;


ALTER TABLE SDSADM.STD_STATISTICALAREA ADD (
  CONSTRAINT PK_STD_STATISTICALAREA
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_STATISTICALAREA
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_STATISTICALAREACODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_STATISTICALAREACODE
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_STATISTICALAREA ADD (
  CONSTRAINT FKSTD_STATISTICALAREAPARENT 
  FOREIGN KEY (PARENT_ID) 
  REFERENCES SDSADM.STD_STATISTICALAREA (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_STTSTCLARSTTSTCLARTYP 
  FOREIGN KEY (STATISTICALAREATYPE_ID) 
  REFERENCES SDSADM.STD_STATISTICALAREATYPE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_STATISTICALAREA TO ADR;

GRANT SELECT ON SDSADM.STD_STATISTICALAREA TO ADREXT;

GRANT SELECT ON SDSADM.STD_STATISTICALAREA TO EESRV;

GRANT SELECT ON SDSADM.STD_STATISTICALAREA TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_STATISTICALAREA TO LOBR;

GRANT SELECT ON SDSADM.STD_STATISTICALAREA TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_STATISTICALAREA TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_STATISTICALAREA TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_STATISTICALAREA TO SDS_SELECT;
ALTER TABLE SDSADM.STD_STATEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_STATEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_STATEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_STATEHISTORY ON SDSADM.STD_STATEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_StateHistory
after DELETE
ON SDSADM.STD_STATEHISTORY
BEGIN
	-- update the table for STD_StateHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StateHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_StateHistory
after INSERT
ON SDSADM.STD_STATEHISTORY
BEGIN
	-- update the table for STD_StateHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StateHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_StateHistory
after UPDATE
ON SDSADM.STD_STATEHISTORY
BEGIN
	-- update the table for STD_StateHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StateHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_STATEHISTORY FOR SDSADM.STD_STATEHISTORY;


ALTER TABLE SDSADM.STD_STATEHISTORY ADD (
  CONSTRAINT PK_STD_STATEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_STATEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_STATEHISTORY ADD (
  CONSTRAINT FKSTD_STATEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_STATE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_STATEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_STATEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_STATEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_STATEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_STATEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_STATEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_STATEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_STATEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_STATEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_STATE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_STATE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_STATE
(
  ID          NUMBER(20)                        NOT NULL,
  NAME        VARCHAR2(50 BYTE)                 NOT NULL,
  POSTALNAME  VARCHAR2(30 BYTE)                 NOT NULL,
  FIPSCODE    CHAR(2 BYTE),
  COUNTRY_ID  NUMBER(20)                        NOT NULL,
  VERSION     INTEGER                           NOT NULL,
  CREATED     TIMESTAMP(6)                      NOT NULL,
  UPDATED     TIMESTAMP(6),
  CREATEDBY   VARCHAR2(32 BYTE)                 NOT NULL,
  UPDATEDBY   VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_STATE ON SDSADM.STD_STATE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_STATEPOSTALNAME ON SDSADM.STD_STATE
(POSTALNAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_State
after DELETE
ON SDSADM.STD_STATE
BEGIN
	-- update the table for STD_State operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_State';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_State
after INSERT
ON SDSADM.STD_STATE
BEGIN
	-- update the table for STD_State operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_State';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_State
after UPDATE
ON SDSADM.STD_STATE
BEGIN
	-- update the table for STD_State operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_State';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_STATE FOR SDSADM.STD_STATE;


ALTER TABLE SDSADM.STD_STATE ADD (
  CONSTRAINT PK_STD_STATE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_STATE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_STATEPOSTALNAME
  UNIQUE (POSTALNAME)
  USING INDEX SDSADM.UQSTD_STATEPOSTALNAME
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_STATE ADD (
  CONSTRAINT FKSTD_STATECOUNTRY 
  FOREIGN KEY (COUNTRY_ID) 
  REFERENCES SDSADM.STD_COUNTRY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_STATE TO ADR;

GRANT SELECT ON SDSADM.STD_STATE TO ADREXT;

GRANT SELECT ON SDSADM.STD_STATE TO EESRV;

GRANT SELECT ON SDSADM.STD_STATE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_STATE TO LOBR;

GRANT SELECT ON SDSADM.STD_STATE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_STATE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_STATE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_STATE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_STATCNTYXREF
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_STATCNTYXREF CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_STATCNTYXREF
(
  COUNTY_ID           NUMBER(20)                NOT NULL,
  STATISTICALAREA_ID  NUMBER(20)                NOT NULL,
  CREATED             TIMESTAMP(6)              NOT NULL,
  UPDATED             TIMESTAMP(6),
  CREATEDBY           VARCHAR2(32 BYTE)         NOT NULL,
  UPDATEDBY           VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_STATCNTYXREF ON SDSADM.STD_STATCNTYXREF
(COUNTY_ID, STATISTICALAREA_ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_StatCntyXref
after DELETE
ON SDSADM.STD_STATCNTYXREF
BEGIN
	-- update the table for STD_StatCntyXref operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatCntyXref';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_StatCntyXref
after INSERT
ON SDSADM.STD_STATCNTYXREF
BEGIN
	-- update the table for STD_StatCntyXref operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatCntyXref';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_StatCntyXref
after UPDATE
ON SDSADM.STD_STATCNTYXREF
BEGIN
	-- update the table for STD_StatCntyXref operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_StatCntyXref';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_STATCNTYXREF FOR SDSADM.STD_STATCNTYXREF;


ALTER TABLE SDSADM.STD_STATCNTYXREF ADD (
  CONSTRAINT PK_STD_STATCNTYXREF
  PRIMARY KEY
  (COUNTY_ID, STATISTICALAREA_ID)
  USING INDEX SDSADM.PK_STD_STATCNTYXREF
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_STATCNTYXREF ADD (
  CONSTRAINT FKSTD_STATCNTYXREFCOUNTY 
  FOREIGN KEY (COUNTY_ID) 
  REFERENCES SDSADM.STD_COUNTY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_STATCNTYXREFSTTSTCLAR 
  FOREIGN KEY (STATISTICALAREA_ID) 
  REFERENCES SDSADM.STD_STATISTICALAREA (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_STATCNTYXREF TO ADR;

GRANT SELECT ON SDSADM.STD_STATCNTYXREF TO ADREXT;

GRANT SELECT ON SDSADM.STD_STATCNTYXREF TO EESRV;

GRANT SELECT ON SDSADM.STD_STATCNTYXREF TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_STATCNTYXREF TO LOBR;

GRANT SELECT ON SDSADM.STD_STATCNTYXREF TO PSIM;

GRANT DELETE, INSERT, SELECT, UPDATE ON SDSADM.STD_STATCNTYXREF TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_STATCNTYXREF TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_STATCNTYXREF TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSNVERIFSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSNVERIFSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSNVERIFSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSNVERIFSTATUSHISTORY ON SDSADM.STD_SSNVERIFSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSNVerifStatusHistory
after DELETE
ON SDSADM.STD_SSNVERIFSTATUSHISTORY
BEGIN
	-- update the table for STD_SSNVerifStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNVerifStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSNVerifStatusHistory
after INSERT
ON SDSADM.STD_SSNVERIFSTATUSHISTORY
BEGIN
	-- update the table for STD_SSNVerifStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNVerifStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSNVerifStatusHistory
after UPDATE
ON SDSADM.STD_SSNVERIFSTATUSHISTORY
BEGIN
	-- update the table for STD_SSNVerifStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNVerifStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSNVERIFSTATUSHISTORY FOR SDSADM.STD_SSNVERIFSTATUSHISTORY;


ALTER TABLE SDSADM.STD_SSNVERIFSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_SSNVERIFSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSNVERIFSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SSNVERIFSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_SSNVERIFSTATUSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SSNVERIFICATIONSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSNVERIFSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SSNVERIFSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSNVERIFSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SSNVERIFSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSNVERIFSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SSNVERIFSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSNVERIFSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSNVERIFSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSNVERIFSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSNVERIFICATIONSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSNVERIFICATIONSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSNVERIFICATIONSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(70 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSNVERIFSTATUS ON SDSADM.STD_SSNVERIFICATIONSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSNVERIFSTATUSCODE ON SDSADM.STD_SSNVERIFICATIONSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSNVERIFSTATUSNAME ON SDSADM.STD_SSNVERIFICATIONSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSNVerifStatus
after DELETE
ON SDSADM.STD_SSNVERIFICATIONSTATUS
BEGIN
	-- update the table for STD_SSNVerificationStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNVerificationStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSNVerifStatus
after INSERT
ON SDSADM.STD_SSNVERIFICATIONSTATUS
BEGIN
	-- update the table for STD_SSNVerificationStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNVerificationStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSNVerifStatus
after UPDATE
ON SDSADM.STD_SSNVERIFICATIONSTATUS
BEGIN
	-- update the table for STD_SSNVerificationStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNVerificationStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSNVERIFICATIONSTATUS FOR SDSADM.STD_SSNVERIFICATIONSTATUS;


ALTER TABLE SDSADM.STD_SSNVERIFICATIONSTATUS ADD (
  CONSTRAINT PK_STD_SSNVERIFSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSNVERIFSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSNVERIFSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SSNVERIFSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSNVERIFSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SSNVERIFSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSNVERIFICATIONSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_SSNVERIFICATIONSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSNVERIFICATIONSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_SSNVERIFICATIONSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSNVERIFICATIONSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_SSNVERIFICATIONSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSNVERIFICATIONSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSNVERIFICATIONSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSNVERIFICATIONSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSNTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSNTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSNTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSNTYPEHISTORY ON SDSADM.STD_SSNTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSNTypeHistory
after DELETE
ON SDSADM.STD_SSNTYPEHISTORY
BEGIN
	-- update the table for STD_SSNTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSNTypeHistory
after INSERT
ON SDSADM.STD_SSNTYPEHISTORY
BEGIN
	-- update the table for STD_SSNTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSNTypeHistory
after UPDATE
ON SDSADM.STD_SSNTYPEHISTORY
BEGIN
	-- update the table for STD_SSNTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSNTYPEHISTORY FOR SDSADM.STD_SSNTYPEHISTORY;


ALTER TABLE SDSADM.STD_SSNTYPEHISTORY ADD (
  CONSTRAINT PK_STD_SSNTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSNTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SSNTYPEHISTORY ADD (
  CONSTRAINT FKSTD_SSNTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SSNTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSNTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SSNTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSNTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SSNTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSNTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SSNTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSNTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSNTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSNTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSNTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSNTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSNTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(30 BYTE)                NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSNTYPE ON SDSADM.STD_SSNTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSNTYPECODE ON SDSADM.STD_SSNTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSNTYPENAME ON SDSADM.STD_SSNTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSNType
after DELETE
ON SDSADM.STD_SSNTYPE
BEGIN
	-- update the table for STD_SSNType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSNType
after INSERT
ON SDSADM.STD_SSNTYPE
BEGIN
	-- update the table for STD_SSNType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSNType
after UPDATE
ON SDSADM.STD_SSNTYPE
BEGIN
	-- update the table for STD_SSNType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSNTYPE FOR SDSADM.STD_SSNTYPE;


ALTER TABLE SDSADM.STD_SSNTYPE ADD (
  CONSTRAINT PK_STD_SSNTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSNTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSNTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SSNTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSNTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SSNTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSNTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_SSNTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSNTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_SSNTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSNTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_SSNTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSNTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSNTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSNTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSNCHANGESOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSNCHANGESOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSNCHANGESOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSNCHANGESOURCEHISTORY ON SDSADM.STD_SSNCHANGESOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSNChangeSourceHstry
after DELETE
ON SDSADM.STD_SSNCHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_SSNChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSNChangeSourceHstry
after INSERT
ON SDSADM.STD_SSNCHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_SSNChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSNChangeSourceHstry
after UPDATE
ON SDSADM.STD_SSNCHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_SSNChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNChangeSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSNCHANGESOURCEHISTORY FOR SDSADM.STD_SSNCHANGESOURCEHISTORY;


ALTER TABLE SDSADM.STD_SSNCHANGESOURCEHISTORY ADD (
  CONSTRAINT PK_STD_SSNCHANGESOURCEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSNCHANGESOURCEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SSNCHANGESOURCEHISTORY ADD (
  CONSTRAINT FKSTD_SSNCHANGESOURCEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SSNCHANGESOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSNCHANGESOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSNCHANGESOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSNCHANGESOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSNCHANGESOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSNCHANGESOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSNCHANGESOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSNCHANGESOURCE ON SDSADM.STD_SSNCHANGESOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSNCHANGESOURCECODE ON SDSADM.STD_SSNCHANGESOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSNCHANGESOURCENAME ON SDSADM.STD_SSNCHANGESOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSNChangeSource
after DELETE
ON SDSADM.STD_SSNCHANGESOURCE
BEGIN
	-- update the table for STD_SSNChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSNChangeSource
after INSERT
ON SDSADM.STD_SSNCHANGESOURCE
BEGIN
	-- update the table for STD_SSNChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSNChangeSource
after UPDATE
ON SDSADM.STD_SSNCHANGESOURCE
BEGIN
	-- update the table for STD_SSNChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSNChangeSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSNCHANGESOURCE FOR SDSADM.STD_SSNCHANGESOURCE;


ALTER TABLE SDSADM.STD_SSNCHANGESOURCE ADD (
  CONSTRAINT PK_STD_SSNCHANGESOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSNCHANGESOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSNCHANGESOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SSNCHANGESOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSNCHANGESOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SSNCHANGESOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSNCHANGESOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSNCHANGESOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSNCHANGESOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSNCHANGESOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSAVERIFCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSAVERIFCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSAVERIFCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSAVERIFCODEHISTORY ON SDSADM.STD_SSAVERIFCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSAVerifCodeHistory
after DELETE
ON SDSADM.STD_SSAVERIFCODEHISTORY
BEGIN
	-- update the table for STD_SSAVerifCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAVerifCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSAVerifCodeHistory
after INSERT
ON SDSADM.STD_SSAVERIFCODEHISTORY
BEGIN
	-- update the table for STD_SSAVerifCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAVerifCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSAVerifCodeHistory
after UPDATE
ON SDSADM.STD_SSAVERIFCODEHISTORY
BEGIN
	-- update the table for STD_SSAVerifCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAVerifCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSAVERIFCODEHISTORY FOR SDSADM.STD_SSAVERIFCODEHISTORY;


ALTER TABLE SDSADM.STD_SSAVERIFCODEHISTORY ADD (
  CONSTRAINT PK_STD_SSAVERIFCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSAVERIFCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SSAVERIFCODEHISTORY ADD (
  CONSTRAINT FKSTD_SSAVERIFCODEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SSAVERIFCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSAVERIFCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSAVERIFCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSAVERIFCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSAVERIFCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSAVERIFCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSAVERIFCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(70 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSAVERIFCODE ON SDSADM.STD_SSAVERIFCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSAVERIFCODECODE ON SDSADM.STD_SSAVERIFCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSAVERIFCODENAME ON SDSADM.STD_SSAVERIFCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSAVerifCode
after DELETE
ON SDSADM.STD_SSAVERIFCODE
BEGIN
	-- update the table for STD_SSAVerifCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAVerifCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSAVerifCode
after INSERT
ON SDSADM.STD_SSAVERIFCODE
BEGIN
	-- update the table for STD_SSAVerifCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAVerifCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSAVerifCode
after UPDATE
ON SDSADM.STD_SSAVERIFCODE
BEGIN
	-- update the table for STD_SSAVerifCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAVerifCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSAVERIFCODE FOR SDSADM.STD_SSAVERIFCODE;


ALTER TABLE SDSADM.STD_SSAVERIFCODE ADD (
  CONSTRAINT PK_STD_SSAVERIFCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSAVERIFCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSAVERIFCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SSAVERIFCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSAVERIFCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SSAVERIFCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSAVERIFCODE TO ADR;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSAVERIFCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSAVERIFCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSAVERIFCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSAMESSAGETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSAMESSAGETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSAMESSAGETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSAMESSAGETYPEHISTORY ON SDSADM.STD_SSAMESSAGETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSAMessageTypeHistory
after DELETE
ON SDSADM.STD_SSAMESSAGETYPEHISTORY
BEGIN
	-- update the table for STD_SSAMessageTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAMessageTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSAMessageTypeHistory
after INSERT
ON SDSADM.STD_SSAMESSAGETYPEHISTORY
BEGIN
	-- update the table for STD_SSAMessageTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAMessageTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSAMessageTypeHistory
after UPDATE
ON SDSADM.STD_SSAMESSAGETYPEHISTORY
BEGIN
	-- update the table for STD_SSAMessageTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAMessageTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSAMESSAGETYPEHISTORY FOR SDSADM.STD_SSAMESSAGETYPEHISTORY;


ALTER TABLE SDSADM.STD_SSAMESSAGETYPEHISTORY ADD (
  CONSTRAINT PK_STD_SSAMESSAGETYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSAMESSAGETYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SSAMESSAGETYPEHISTORY ADD (
  CONSTRAINT FKSTD_SSAMESSAGETYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SSAMESSAGETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSAMESSAGETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSAMESSAGETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSAMESSAGETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SSAMESSAGETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SSAMESSAGETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SSAMESSAGETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SSAMESSAGETYPE ON SDSADM.STD_SSAMESSAGETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSAMESSAGETYPECODE ON SDSADM.STD_SSAMESSAGETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SSAMESSAGETYPENAME ON SDSADM.STD_SSAMESSAGETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SSAMessageType
after DELETE
ON SDSADM.STD_SSAMESSAGETYPE
BEGIN
	-- update the table for STD_SSAMessageType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAMessageType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SSAMessageType
after INSERT
ON SDSADM.STD_SSAMESSAGETYPE
BEGIN
	-- update the table for STD_SSAMessageType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAMessageType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SSAMessageType
after UPDATE
ON SDSADM.STD_SSAMESSAGETYPE
BEGIN
	-- update the table for STD_SSAMessageType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SSAMessageType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SSAMESSAGETYPE FOR SDSADM.STD_SSAMESSAGETYPE;


ALTER TABLE SDSADM.STD_SSAMESSAGETYPE ADD (
  CONSTRAINT PK_STD_SSAMESSAGETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SSAMESSAGETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSAMESSAGETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SSAMESSAGETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SSAMESSAGETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SSAMESSAGETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SSAMESSAGETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SSAMESSAGETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SSAMESSAGETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SSAMESSAGETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SPINALINJURYCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SPINALINJURYCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SPINALINJURYCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SPINALINJURYCODEHISTORY ON SDSADM.STD_SPINALINJURYCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SpinalInjuryCodeHstry
after DELETE
ON SDSADM.STD_SPINALINJURYCODEHISTORY
BEGIN
	-- update the table for STD_SpinalInjuryCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpinalInjuryCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SpinalInjuryCodeHstry
after INSERT
ON SDSADM.STD_SPINALINJURYCODEHISTORY
BEGIN
	-- update the table for STD_SpinalInjuryCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpinalInjuryCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SpinalInjuryCodeHstry
after UPDATE
ON SDSADM.STD_SPINALINJURYCODEHISTORY
BEGIN
	-- update the table for STD_SpinalInjuryCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpinalInjuryCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SPINALINJURYCODEHISTORY FOR SDSADM.STD_SPINALINJURYCODEHISTORY;


ALTER TABLE SDSADM.STD_SPINALINJURYCODEHISTORY ADD (
  CONSTRAINT PK_STD_SPINALINJURYCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SPINALINJURYCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SPINALINJURYCODEHISTORY ADD (
  CONSTRAINT FKSTD_SPINALINJURYCDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SPINALINJURYCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SPINALINJURYCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SPINALINJURYCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SPINALINJURYCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SPINALINJURYCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SPINALINJURYCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SPINALINJURYCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(200 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SPINALINJURYCODE ON SDSADM.STD_SPINALINJURYCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SPINALINJURYCODECODE ON SDSADM.STD_SPINALINJURYCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SPINALINJURYCODENAME ON SDSADM.STD_SPINALINJURYCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SpinalInjuryCode
after DELETE
ON SDSADM.STD_SPINALINJURYCODE
BEGIN
	-- update the table for STD_SpinalInjuryCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpinalInjuryCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SpinalInjuryCode
after INSERT
ON SDSADM.STD_SPINALINJURYCODE
BEGIN
	-- update the table for STD_SpinalInjuryCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpinalInjuryCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SpinalInjuryCode
after UPDATE
ON SDSADM.STD_SPINALINJURYCODE
BEGIN
	-- update the table for STD_SpinalInjuryCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpinalInjuryCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SPINALINJURYCODE FOR SDSADM.STD_SPINALINJURYCODE;


ALTER TABLE SDSADM.STD_SPINALINJURYCODE ADD (
  CONSTRAINT PK_STD_SPINALINJURYCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SPINALINJURYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SPINALINJURYCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SPINALINJURYCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SPINALINJURYCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SPINALINJURYCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SPINALINJURYCODE TO ADR;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SPINALINJURYCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SPINALINJURYCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SPINALINJURYCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SPECIALTYSERVICEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SPECIALTYSERVICEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SPECIALTYSERVICEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SPECIALTYSERVICEHISTORY ON SDSADM.STD_SPECIALTYSERVICEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SpecialtyServiceHstry
after DELETE
ON SDSADM.STD_SPECIALTYSERVICEHISTORY
BEGIN
	-- update the table for STD_SpecialtyServiceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialtyServiceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SpecialtyServiceHstry
after INSERT
ON SDSADM.STD_SPECIALTYSERVICEHISTORY
BEGIN
	-- update the table for STD_SpecialtyServiceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialtyServiceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SpecialtyServiceHstry
after UPDATE
ON SDSADM.STD_SPECIALTYSERVICEHISTORY
BEGIN
	-- update the table for STD_SpecialtyServiceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialtyServiceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SPECIALTYSERVICEHISTORY FOR SDSADM.STD_SPECIALTYSERVICEHISTORY;


ALTER TABLE SDSADM.STD_SPECIALTYSERVICEHISTORY ADD (
  CONSTRAINT PK_STD_SPECIALTYSERVICEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SPECIALTYSERVICEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SPECIALTYSERVICEHISTORY ADD (
  CONSTRAINT FKSTD_SPECIALTYSRVCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SPECIALTYSERVICE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SPECIALTYSERVICEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SPECIALTYSERVICEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SPECIALTYSERVICEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SPECIALTYSERVICE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SPECIALTYSERVICE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SPECIALTYSERVICE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(20 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SPECIALTYSERVICE ON SDSADM.STD_SPECIALTYSERVICE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SPECIALTYSERVICECODE ON SDSADM.STD_SPECIALTYSERVICE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SPECIALTYSERVICENAME ON SDSADM.STD_SPECIALTYSERVICE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SpecialtyService
after DELETE
ON SDSADM.STD_SPECIALTYSERVICE
BEGIN
	-- update the table for STD_SpecialtyService operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialtyService';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SpecialtyService
after INSERT
ON SDSADM.STD_SPECIALTYSERVICE
BEGIN
	-- update the table for STD_SpecialtyService operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialtyService';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SpecialtyService
after UPDATE
ON SDSADM.STD_SPECIALTYSERVICE
BEGIN
	-- update the table for STD_SpecialtyService operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialtyService';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SPECIALTYSERVICE FOR SDSADM.STD_SPECIALTYSERVICE;


ALTER TABLE SDSADM.STD_SPECIALTYSERVICE ADD (
  CONSTRAINT PK_STD_SPECIALTYSERVICE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SPECIALTYSERVICE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SPECIALTYSERVICECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SPECIALTYSERVICECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SPECIALTYSERVICENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SPECIALTYSERVICENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SPECIALTYSERVICE TO ADR;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICE TO EESRV;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SPECIALTYSERVICE TO LOBR;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SPECIALTYSERVICE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SPECIALTYSERVICE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SPECIALOPERATIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SPECIALOPERATIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SPECIALOPERATIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SPECIALOPERATIONHISTORY ON SDSADM.STD_SPECIALOPERATIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SpecialOperationHstry
after DELETE
ON SDSADM.STD_SPECIALOPERATIONHISTORY
BEGIN
	-- update the table for STD_SpecialOperationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialOperationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SpecialOperationHstry
after INSERT
ON SDSADM.STD_SPECIALOPERATIONHISTORY
BEGIN
	-- update the table for STD_SpecialOperationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialOperationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SpecialOperationHstry
after UPDATE
ON SDSADM.STD_SPECIALOPERATIONHISTORY
BEGIN
	-- update the table for STD_SpecialOperationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialOperationHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SPECIALOPERATIONHISTORY FOR SDSADM.STD_SPECIALOPERATIONHISTORY;


ALTER TABLE SDSADM.STD_SPECIALOPERATIONHISTORY ADD (
  CONSTRAINT PK_STD_SPECIALOPERATIONHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SPECIALOPERATIONHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SPECIALOPERATIONHISTORY ADD (
  CONSTRAINT FKSTD_SPECIALOPRTNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SPECIALOPERATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SPECIALOPERATIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SPECIALOPERATIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SPECIALOPERATIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SPECIALOPERATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SPECIALOPERATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SPECIALOPERATION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(8 BYTE)                 NOT NULL,
  NAME         VARCHAR2(35 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SPECIALOPERATION ON SDSADM.STD_SPECIALOPERATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SPECIALOPERATIONCODE ON SDSADM.STD_SPECIALOPERATION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SPECIALOPERATIONNAME ON SDSADM.STD_SPECIALOPERATION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SpecialOperation
after DELETE
ON SDSADM.STD_SPECIALOPERATION
BEGIN
	-- update the table for STD_SpecialOperation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialOperation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SpecialOperation
after INSERT
ON SDSADM.STD_SPECIALOPERATION
BEGIN
	-- update the table for STD_SpecialOperation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialOperation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SpecialOperation
after UPDATE
ON SDSADM.STD_SPECIALOPERATION
BEGIN
	-- update the table for STD_SpecialOperation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialOperation';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SPECIALOPERATION FOR SDSADM.STD_SPECIALOPERATION;


ALTER TABLE SDSADM.STD_SPECIALOPERATION ADD (
  CONSTRAINT PK_STD_SPECIALOPERATION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SPECIALOPERATION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SPECIALOPERATIONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SPECIALOPERATIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SPECIALOPERATIONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SPECIALOPERATIONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SPECIALOPERATION TO ADR;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATION TO EESRV;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SPECIALOPERATION TO LOBR;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SPECIALOPERATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SPECIALOPERATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SPECIALFACTORMAPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SPECIALFACTORMAPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SPECIALFACTORMAPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SPECIALFACTORMAPHISTORY ON SDSADM.STD_SPECIALFACTORMAPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SpecialFactorMapHstry
after DELETE
ON SDSADM.STD_SPECIALFACTORMAPHISTORY
BEGIN
	-- update the table for STD_SpecialFactorMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialFactorMapHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SpecialFactorMapHstry
after INSERT
ON SDSADM.STD_SPECIALFACTORMAPHISTORY
BEGIN
	-- update the table for STD_SpecialFactorMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialFactorMapHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SpecialFactorMapHstry
after UPDATE
ON SDSADM.STD_SPECIALFACTORMAPHISTORY
BEGIN
	-- update the table for STD_SpecialFactorMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialFactorMapHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SPECIALFACTORMAPHISTORY FOR SDSADM.STD_SPECIALFACTORMAPHISTORY;


ALTER TABLE SDSADM.STD_SPECIALFACTORMAPHISTORY ADD (
  CONSTRAINT PK_STD_SPECIALFACTORMAPHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SPECIALFACTORMAPHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SPECIALFACTORMAPHISTORY ADD (
  CONSTRAINT FKSTD_SPECIALFACTORMPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SPECIALFACTORMAP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SPECIALFACTORMAPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SPECIALFACTORMAPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SPECIALFACTORMAPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SPECIALFACTORMAP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SPECIALFACTORMAP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SPECIALFACTORMAP
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SPECIALFACTORMAP ON SDSADM.STD_SPECIALFACTORMAP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SPECIALFACTORMAPCODE ON SDSADM.STD_SPECIALFACTORMAP
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SPECIALFACTORMAPNAME ON SDSADM.STD_SPECIALFACTORMAP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SpecialFactorMap
after DELETE
ON SDSADM.STD_SPECIALFACTORMAP
BEGIN
	-- update the table for STD_SpecialFactorMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialFactorMap';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SpecialFactorMap
after INSERT
ON SDSADM.STD_SPECIALFACTORMAP
BEGIN
	-- update the table for STD_SpecialFactorMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialFactorMap';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SpecialFactorMap
after UPDATE
ON SDSADM.STD_SPECIALFACTORMAP
BEGIN
	-- update the table for STD_SpecialFactorMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SpecialFactorMap';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SPECIALFACTORMAP FOR SDSADM.STD_SPECIALFACTORMAP;


ALTER TABLE SDSADM.STD_SPECIALFACTORMAP ADD (
  CONSTRAINT PK_STD_SPECIALFACTORMAP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SPECIALFACTORMAP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SPECIALFACTORMAPCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SPECIALFACTORMAPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SPECIALFACTORMAPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SPECIALFACTORMAPNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SPECIALFACTORMAP TO ADR;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAP TO ADREXT;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAP TO EESRV;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SPECIALFACTORMAP TO LOBR;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SPECIALFACTORMAP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SPECIALFACTORMAP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SITEUPLOADSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SITEUPLOADSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SITEUPLOADSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SITEUPLOADSTATUSHISTORY ON SDSADM.STD_SITEUPLOADSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SiteUploadStatusHstry
after DELETE
ON SDSADM.STD_SITEUPLOADSTATUSHISTORY
BEGIN
	-- update the table for STD_SiteUploadStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SiteUploadStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SiteUploadStatusHstry
after INSERT
ON SDSADM.STD_SITEUPLOADSTATUSHISTORY
BEGIN
	-- update the table for STD_SiteUploadStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SiteUploadStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SiteUploadStatusHstry
after UPDATE
ON SDSADM.STD_SITEUPLOADSTATUSHISTORY
BEGIN
	-- update the table for STD_SiteUploadStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SiteUploadStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SITEUPLOADSTATUSHISTORY FOR SDSADM.STD_SITEUPLOADSTATUSHISTORY;


ALTER TABLE SDSADM.STD_SITEUPLOADSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_SITEUPLOADSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SITEUPLOADSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SITEUPLOADSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_SITEUPLOADSTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SITEUPLOADSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SITEUPLOADSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SITEUPLOADSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SITEUPLOADSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SITEUPLOADSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SITEUPLOADSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SITEUPLOADSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SITEUPLOADSTATUS ON SDSADM.STD_SITEUPLOADSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SITEUPLOADSTATUSCODE ON SDSADM.STD_SITEUPLOADSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SITEUPLOADSTATUSNAME ON SDSADM.STD_SITEUPLOADSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SiteUploadStatus
after DELETE
ON SDSADM.STD_SITEUPLOADSTATUS
BEGIN
	-- update the table for STD_SiteUploadStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SiteUploadStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SiteUploadStatus
after INSERT
ON SDSADM.STD_SITEUPLOADSTATUS
BEGIN
	-- update the table for STD_SiteUploadStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SiteUploadStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SiteUploadStatus
after UPDATE
ON SDSADM.STD_SITEUPLOADSTATUS
BEGIN
	-- update the table for STD_SiteUploadStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SiteUploadStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SITEUPLOADSTATUS FOR SDSADM.STD_SITEUPLOADSTATUS;


ALTER TABLE SDSADM.STD_SITEUPLOADSTATUS ADD (
  CONSTRAINT PK_STD_SITEUPLOADSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SITEUPLOADSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SITEUPLOADSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SITEUPLOADSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SITEUPLOADSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SITEUPLOADSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SITEUPLOADSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SITEUPLOADSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SITEUPLOADSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SITEUPLOADSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SIGNATUREINDTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SIGNATUREINDTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SIGNATUREINDTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SIGNATUREINDTYPEHISTORY ON SDSADM.STD_SIGNATUREINDTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SignatureIndTypeHstry
after DELETE
ON SDSADM.STD_SIGNATUREINDTYPEHISTORY
BEGIN
	-- update the table for STD_SignatureIndTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SignatureIndTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SignatureIndTypeHstry
after INSERT
ON SDSADM.STD_SIGNATUREINDTYPEHISTORY
BEGIN
	-- update the table for STD_SignatureIndTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SignatureIndTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SignatureIndTypeHstry
after UPDATE
ON SDSADM.STD_SIGNATUREINDTYPEHISTORY
BEGIN
	-- update the table for STD_SignatureIndTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SignatureIndTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SIGNATUREINDTYPEHISTORY FOR SDSADM.STD_SIGNATUREINDTYPEHISTORY;


ALTER TABLE SDSADM.STD_SIGNATUREINDTYPEHISTORY ADD (
  CONSTRAINT PK_STD_SIGNATUREINDTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SIGNATUREINDTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SIGNATUREINDTYPEHISTORY ADD (
  CONSTRAINT FKSTD_SIGNATUREINDTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SIGNATUREINDTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SIGNATUREINDTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SIGNATUREINDTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SIGNATUREINDTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SIGNATUREINDTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SIGNATUREINDTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SIGNATUREINDTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(40 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SIGNATUREINDTYPE ON SDSADM.STD_SIGNATUREINDTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SIGNATUREINDTYPECODE ON SDSADM.STD_SIGNATUREINDTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SIGNATUREINDTYPENAME ON SDSADM.STD_SIGNATUREINDTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SignatureIndType
after DELETE
ON SDSADM.STD_SIGNATUREINDTYPE
BEGIN
	-- update the table for STD_SignatureIndType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SignatureIndType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SignatureIndType
after INSERT
ON SDSADM.STD_SIGNATUREINDTYPE
BEGIN
	-- update the table for STD_SignatureIndType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SignatureIndType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SignatureIndType
after UPDATE
ON SDSADM.STD_SIGNATUREINDTYPE
BEGIN
	-- update the table for STD_SignatureIndType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SignatureIndType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SIGNATUREINDTYPE FOR SDSADM.STD_SIGNATUREINDTYPE;


ALTER TABLE SDSADM.STD_SIGNATUREINDTYPE ADD (
  CONSTRAINT PK_STD_SIGNATUREINDTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SIGNATUREINDTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SIGNATUREINDTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SIGNATUREINDTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SIGNATUREINDTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SIGNATUREINDTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SIGNATUREINDTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SIGNATUREINDTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SIGNATUREINDTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SIGNATUREINDTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SHADDOCUMENTTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SHADDOCUMENTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SHADDOCUMENTTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SHADDOCUMENTTYPEHISTORY ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SHADDocumentTypeHstry
after DELETE
ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY
BEGIN
	-- update the table for STD_SHADDocumentTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SHADDocumentTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SHADDocumentTypeHstry
after INSERT
ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY
BEGIN
	-- update the table for STD_SHADDocumentTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SHADDocumentTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SHADDocumentTypeHstry
after UPDATE
ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY
BEGIN
	-- update the table for STD_SHADDocumentTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SHADDocumentTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SHADDOCUMENTTYPEHISTORY FOR SDSADM.STD_SHADDOCUMENTTYPEHISTORY;


ALTER TABLE SDSADM.STD_SHADDOCUMENTTYPEHISTORY ADD (
  CONSTRAINT PK_STD_SHADDOCUMENTTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SHADDOCUMENTTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SHADDOCUMENTTYPEHISTORY ADD (
  CONSTRAINT FKSTD_SHADDOCUMENTTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SHADDOCUMENTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SHADDOCUMENTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SHADDOCUMENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SHADDOCUMENTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(1 BYTE)                 NOT NULL,
  NAME         VARCHAR2(60 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SHADDOCUMENTTYPE ON SDSADM.STD_SHADDOCUMENTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SHADDOCUMENTTYPECODE ON SDSADM.STD_SHADDOCUMENTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SHADDOCUMENTTYPENAME ON SDSADM.STD_SHADDOCUMENTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SHADDocumentType
after DELETE
ON SDSADM.STD_SHADDOCUMENTTYPE
BEGIN
	-- update the table for STD_SHADDocumentType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SHADDocumentType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SHADDocumentType
after INSERT
ON SDSADM.STD_SHADDOCUMENTTYPE
BEGIN
	-- update the table for STD_SHADDocumentType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SHADDocumentType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SHADDocumentType
after UPDATE
ON SDSADM.STD_SHADDOCUMENTTYPE
BEGIN
	-- update the table for STD_SHADDocumentType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SHADDocumentType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SHADDOCUMENTTYPE FOR SDSADM.STD_SHADDOCUMENTTYPE;


ALTER TABLE SDSADM.STD_SHADDOCUMENTTYPE ADD (
  CONSTRAINT PK_STD_SHADDOCUMENTTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SHADDOCUMENTTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SHADDOCUMENTTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SHADDOCUMENTTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SHADDOCUMENTTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SHADDOCUMENTTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SHADDOCUMENTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SHADDOCUMENTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SHADDOCUMENTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SHADDOCUMENTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SERVICEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SERVICEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SERVICEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SERVICEHISTORY ON SDSADM.STD_SERVICEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ServiceHistory
after DELETE
ON SDSADM.STD_SERVICEHISTORY
BEGIN
	-- update the table for STD_ServiceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ServiceHistory
after INSERT
ON SDSADM.STD_SERVICEHISTORY
BEGIN
	-- update the table for STD_ServiceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ServiceHistory
after UPDATE
ON SDSADM.STD_SERVICEHISTORY
BEGIN
	-- update the table for STD_ServiceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SERVICEHISTORY FOR SDSADM.STD_SERVICEHISTORY;


ALTER TABLE SDSADM.STD_SERVICEHISTORY ADD (
  CONSTRAINT PK_STD_SERVICEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SERVICEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SERVICEHISTORY ADD (
  CONSTRAINT FKSTD_SERVICEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SERVICE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SERVICEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SERVICEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SERVICEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SERVICEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SERVICEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SERVICEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SERVICEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SERVICEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SERVICEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SERVICEDISCHARGECODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SERVICEDISCHARGECODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SERVICEDISCHARGECODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SVCDSCHRGCD ON SDSADM.STD_SERVICEDISCHARGECODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SVCDSCHRGCDCODE ON SDSADM.STD_SERVICEDISCHARGECODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SVCDSCHRGCDNAME ON SDSADM.STD_SERVICEDISCHARGECODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SvcDschrgCd
after DELETE
ON SDSADM.STD_SERVICEDISCHARGECODE
BEGIN
	-- update the table for STD_ServiceDischargeCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceDischargeCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SvcDschrgCd
after INSERT
ON SDSADM.STD_SERVICEDISCHARGECODE
BEGIN
	-- update the table for STD_ServiceDischargeCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceDischargeCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SvcDschrgCd
after UPDATE
ON SDSADM.STD_SERVICEDISCHARGECODE
BEGIN
	-- update the table for STD_ServiceDischargeCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceDischargeCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SERVICEDISCHARGECODE FOR SDSADM.STD_SERVICEDISCHARGECODE;


ALTER TABLE SDSADM.STD_SERVICEDISCHARGECODE ADD (
  CONSTRAINT PK_STD_SVCDSCHRGCD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SVCDSCHRGCD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SVCDSCHRGCDCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SVCDSCHRGCDCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SVCDSCHRGCDNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SVCDSCHRGCDNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SERVICEDISCHARGECODE TO ADR;

GRANT SELECT ON SDSADM.STD_SERVICEDISCHARGECODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SERVICEDISCHARGECODE TO EESRV;

GRANT SELECT ON SDSADM.STD_SERVICEDISCHARGECODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SERVICEDISCHARGECODE TO LOBR;

GRANT SELECT ON SDSADM.STD_SERVICEDISCHARGECODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SERVICEDISCHARGECODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SERVICEDISCHARGECODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SERVICEDISCHARGECODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SERVICEBRANCHHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SERVICEBRANCHHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SERVICEBRANCHHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SERVICEBRANCHHISTORY ON SDSADM.STD_SERVICEBRANCHHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ServiceBranchHistory
after DELETE
ON SDSADM.STD_SERVICEBRANCHHISTORY
BEGIN
	-- update the table for STD_ServiceBranchHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceBranchHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ServiceBranchHistory
after INSERT
ON SDSADM.STD_SERVICEBRANCHHISTORY
BEGIN
	-- update the table for STD_ServiceBranchHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceBranchHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ServiceBranchHistory
after UPDATE
ON SDSADM.STD_SERVICEBRANCHHISTORY
BEGIN
	-- update the table for STD_ServiceBranchHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceBranchHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SERVICEBRANCHHISTORY FOR SDSADM.STD_SERVICEBRANCHHISTORY;


ALTER TABLE SDSADM.STD_SERVICEBRANCHHISTORY ADD (
  CONSTRAINT PK_STD_SERVICEBRANCHHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SERVICEBRANCHHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SERVICEBRANCHHISTORY ADD (
  CONSTRAINT FKSTD_SERVICEBRANCHHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SERVICEBRANCH (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SERVICEBRANCHHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCHHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCHHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCHHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SERVICEBRANCHHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCHHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SERVICEBRANCHHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCHHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCHHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SERVICEBRANCH
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SERVICEBRANCH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SERVICEBRANCH
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SERVICEBRANCH ON SDSADM.STD_SERVICEBRANCH
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SERVICEBRANCHCODE ON SDSADM.STD_SERVICEBRANCH
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SERVICEBRANCHNAME ON SDSADM.STD_SERVICEBRANCH
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ServiceBranch
after DELETE
ON SDSADM.STD_SERVICEBRANCH
BEGIN
	-- update the table for STD_ServiceBranch operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceBranch';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ServiceBranch
after INSERT
ON SDSADM.STD_SERVICEBRANCH
BEGIN
	-- update the table for STD_ServiceBranch operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceBranch';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ServiceBranch
after UPDATE
ON SDSADM.STD_SERVICEBRANCH
BEGIN
	-- update the table for STD_ServiceBranch operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ServiceBranch';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SERVICEBRANCH FOR SDSADM.STD_SERVICEBRANCH;


ALTER TABLE SDSADM.STD_SERVICEBRANCH ADD (
  CONSTRAINT PK_STD_SERVICEBRANCH
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SERVICEBRANCH
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SERVICEBRANCHCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SERVICEBRANCHCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SERVICEBRANCHNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SERVICEBRANCHNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SERVICEBRANCH TO ADR;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCH TO ADREXT;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCH TO EESRV;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCH TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SERVICEBRANCH TO LOBR;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCH TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SERVICEBRANCH TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCH TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SERVICEBRANCH TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SERVICE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SERVICE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SERVICE
(
  ID                NUMBER(20)                  NOT NULL,
  NAME              VARCHAR2(50 BYTE)           NOT NULL,
  ROUTINGSYMBOL     VARCHAR2(7 BYTE),
  DSSSERVICECODE    CHAR(1 BYTE),
  VACOSTCENTER      CHAR(3 BYTE),
  GENERALPRIVILEGE  VARCHAR2(1000 BYTE),
  VERSION           INTEGER                     NOT NULL,
  CREATED           TIMESTAMP(6)                NOT NULL,
  UPDATED           TIMESTAMP(6),
  CREATEDBY         VARCHAR2(32 BYTE)           NOT NULL,
  UPDATEDBY         VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SERVICE ON SDSADM.STD_SERVICE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SERVICENAME ON SDSADM.STD_SERVICE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Service
after DELETE
ON SDSADM.STD_SERVICE
BEGIN
	-- update the table for STD_Service operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Service';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Service
after INSERT
ON SDSADM.STD_SERVICE
BEGIN
	-- update the table for STD_Service operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Service';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Service
after UPDATE
ON SDSADM.STD_SERVICE
BEGIN
	-- update the table for STD_Service operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Service';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SERVICE FOR SDSADM.STD_SERVICE;


ALTER TABLE SDSADM.STD_SERVICE ADD (
  CONSTRAINT PK_STD_SERVICE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SERVICE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SERVICENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SERVICENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SERVICE TO ADR;

GRANT SELECT ON SDSADM.STD_SERVICE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SERVICE TO EESRV;

GRANT SELECT ON SDSADM.STD_SERVICE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SERVICE TO LOBR;

GRANT SELECT ON SDSADM.STD_SERVICE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SERVICE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SERVICE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SERVICE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SENSITIVITYCHNGSRCHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SENSITIVITYCHNGSRCHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SENSITIVITYCHNGSRCHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SENSITIVITYCHNGSRCHSTRY ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SnstvtyChngSrcHstry
after DELETE
ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY
BEGIN
	-- update the table for STD_SensitivityChngSrcHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SensitivityChngSrcHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SnstvtyChngSrcHstry
after INSERT
ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY
BEGIN
	-- update the table for STD_SensitivityChngSrcHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SensitivityChngSrcHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SnstvtyChngSrcHstry
after UPDATE
ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY
BEGIN
	-- update the table for STD_SensitivityChngSrcHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SensitivityChngSrcHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SENSITIVITYCHNGSRCHISTORY FOR SDSADM.STD_SENSITIVITYCHNGSRCHISTORY;


ALTER TABLE SDSADM.STD_SENSITIVITYCHNGSRCHISTORY ADD (
  CONSTRAINT PK_STD_SENSITIVITYCHNGSRCHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SENSITIVITYCHNGSRCHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SENSITIVITYCHNGSRCHISTORY ADD (
  CONSTRAINT FKSTD_SNSTVTYCHNGSRCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SENSITIVITYCHANGESOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHNGSRCHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SENSITIVITYCHANGESOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SENSITIVITYCHANGESOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SENSITIVITYCHANGESOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SENSITIVITYCHNGSRC ON SDSADM.STD_SENSITIVITYCHANGESOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SENSITIVITYCHNGSRCCODE ON SDSADM.STD_SENSITIVITYCHANGESOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SENSITIVITYCHNGSRCNAME ON SDSADM.STD_SENSITIVITYCHANGESOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SensitivityChngSrc
after DELETE
ON SDSADM.STD_SENSITIVITYCHANGESOURCE
BEGIN
	-- update the table for STD_SensitivityChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SensitivityChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SensitivityChngSrc
after INSERT
ON SDSADM.STD_SENSITIVITYCHANGESOURCE
BEGIN
	-- update the table for STD_SensitivityChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SensitivityChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SensitivityChngSrc
after UPDATE
ON SDSADM.STD_SENSITIVITYCHANGESOURCE
BEGIN
	-- update the table for STD_SensitivityChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SensitivityChangeSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SENSITIVITYCHANGESOURCE FOR SDSADM.STD_SENSITIVITYCHANGESOURCE;


ALTER TABLE SDSADM.STD_SENSITIVITYCHANGESOURCE ADD (
  CONSTRAINT PK_STD_SENSITIVITYCHNGSRC
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SENSITIVITYCHNGSRC
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SENSITIVITYCHNGSRCCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SENSITIVITYCHNGSRCCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SENSITIVITYCHNGSRCNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SENSITIVITYCHNGSRCNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SENSITIVITYCHANGESOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHANGESOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHANGESOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHANGESOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SENSITIVITYCHANGESOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHANGESOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SENSITIVITYCHANGESOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHANGESOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SENSITIVITYCHANGESOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SEEDSTATUSCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SEEDSTATUSCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SEEDSTATUSCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SEEDSTATUSCODEHISTORY ON SDSADM.STD_SEEDSTATUSCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SeedStatusCodeHistory
after DELETE
ON SDSADM.STD_SEEDSTATUSCODEHISTORY
BEGIN
	-- update the table for STD_SeedStatusCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SeedStatusCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SeedStatusCodeHistory
after INSERT
ON SDSADM.STD_SEEDSTATUSCODEHISTORY
BEGIN
	-- update the table for STD_SeedStatusCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SeedStatusCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SeedStatusCodeHistory
after UPDATE
ON SDSADM.STD_SEEDSTATUSCODEHISTORY
BEGIN
	-- update the table for STD_SeedStatusCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SeedStatusCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SEEDSTATUSCODEHISTORY FOR SDSADM.STD_SEEDSTATUSCODEHISTORY;


ALTER TABLE SDSADM.STD_SEEDSTATUSCODEHISTORY ADD (
  CONSTRAINT PK_STD_SEEDSTATUSCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SEEDSTATUSCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_SEEDSTATUSCODEHISTORY ADD (
  CONSTRAINT FKSTD_SEEDSTATUSCODEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_SEEDSTATUSCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SEEDSTATUSCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SEEDSTATUSCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SEEDSTATUSCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_SEEDSTATUSCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_SEEDSTATUSCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_SEEDSTATUSCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(8 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(30 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_SEEDSTATUSCODE ON SDSADM.STD_SEEDSTATUSCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SEEDSTATUSCODECODE ON SDSADM.STD_SEEDSTATUSCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_SEEDSTATUSCODENAME ON SDSADM.STD_SEEDSTATUSCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_SeedStatusCode
after DELETE
ON SDSADM.STD_SEEDSTATUSCODE
BEGIN
	-- update the table for STD_SeedStatusCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SeedStatusCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_SeedStatusCode
after INSERT
ON SDSADM.STD_SEEDSTATUSCODE
BEGIN
	-- update the table for STD_SeedStatusCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SeedStatusCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_SeedStatusCode
after UPDATE
ON SDSADM.STD_SEEDSTATUSCODE
BEGIN
	-- update the table for STD_SeedStatusCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_SeedStatusCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_SEEDSTATUSCODE FOR SDSADM.STD_SEEDSTATUSCODE;


ALTER TABLE SDSADM.STD_SEEDSTATUSCODE ADD (
  CONSTRAINT PK_STD_SEEDSTATUSCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_SEEDSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SEEDSTATUSCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_SEEDSTATUSCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_SEEDSTATUSCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_SEEDSTATUSCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_SEEDSTATUSCODE TO ADR;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_SEEDSTATUSCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_SEEDSTATUSCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_SEEDSTATUSCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELTOVETINSURANCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELTOVETINSURANCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELTOVETINSURANCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELTOVETINSURANCEHSTRY ON SDSADM.STD_RELTOVETINSURANCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RelToVetInsrncHstry
after DELETE
ON SDSADM.STD_RELTOVETINSURANCEHISTORY
BEGIN
	-- update the table for STD_RelToVetInsuranceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelToVetInsuranceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RelToVetInsrncHstry
after INSERT
ON SDSADM.STD_RELTOVETINSURANCEHISTORY
BEGIN
	-- update the table for STD_RelToVetInsuranceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelToVetInsuranceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RelToVetInsrncHstry
after UPDATE
ON SDSADM.STD_RELTOVETINSURANCEHISTORY
BEGIN
	-- update the table for STD_RelToVetInsuranceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelToVetInsuranceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELTOVETINSURANCEHISTORY FOR SDSADM.STD_RELTOVETINSURANCEHISTORY;


ALTER TABLE SDSADM.STD_RELTOVETINSURANCEHISTORY ADD (
  CONSTRAINT PK_STD_RELTOVETINSURANCEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELTOVETINSURANCEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_RELTOVETINSURANCEHISTORY ADD (
  CONSTRAINT FKSTD_RELTOVETINSRNCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_RELTOVETINSURANCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELTOVETINSURANCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELTOVETINSURANCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELTOVETINSURANCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELTOVETINSURANCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELTOVETINSURANCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELTOVETINSURANCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELTOVETINSURANCE ON SDSADM.STD_RELTOVETINSURANCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RELTOVETINSURANCECODE ON SDSADM.STD_RELTOVETINSURANCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RelToVetInsurance
after DELETE
ON SDSADM.STD_RELTOVETINSURANCE
BEGIN
	-- update the table for STD_RelToVetInsurance operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelToVetInsurance';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RelToVetInsurance
after INSERT
ON SDSADM.STD_RELTOVETINSURANCE
BEGIN
	-- update the table for STD_RelToVetInsurance operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelToVetInsurance';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RelToVetInsurance
after UPDATE
ON SDSADM.STD_RELTOVETINSURANCE
BEGIN
	-- update the table for STD_RelToVetInsurance operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelToVetInsurance';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELTOVETINSURANCE FOR SDSADM.STD_RELTOVETINSURANCE;


ALTER TABLE SDSADM.STD_RELTOVETINSURANCE ADD (
  CONSTRAINT PK_STD_RELTOVETINSURANCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELTOVETINSURANCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RELTOVETINSURANCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_RELTOVETINSURANCECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELTOVETINSURANCE TO ADR;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCE TO EESRV;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELTOVETINSURANCE TO LOBR;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELTOVETINSURANCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELTOVETINSURANCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELIGIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELIGIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELIGIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELIGIONHISTORY ON SDSADM.STD_RELIGIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ReligionHistory
after DELETE
ON SDSADM.STD_RELIGIONHISTORY
BEGIN
	-- update the table for STD_ReligionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ReligionHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ReligionHistory
after INSERT
ON SDSADM.STD_RELIGIONHISTORY
BEGIN
	-- update the table for STD_ReligionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ReligionHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ReligionHistory
after UPDATE
ON SDSADM.STD_RELIGIONHISTORY
BEGIN
	-- update the table for STD_ReligionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ReligionHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELIGIONHISTORY FOR SDSADM.STD_RELIGIONHISTORY;


ALTER TABLE SDSADM.STD_RELIGIONHISTORY ADD (
  CONSTRAINT PK_STD_RELIGIONHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELIGIONHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_RELIGIONHISTORY ADD (
  CONSTRAINT FKSTD_RELIGIONHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_RELIGION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELIGIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_RELIGIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELIGIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_RELIGIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELIGIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_RELIGIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELIGIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELIGIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELIGIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELIGION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELIGION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELIGION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(49 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELIGION ON SDSADM.STD_RELIGION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RELIGIONCODE ON SDSADM.STD_RELIGION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RELIGIONNAME ON SDSADM.STD_RELIGION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Religion
after DELETE
ON SDSADM.STD_RELIGION
BEGIN
	-- update the table for STD_Religion operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Religion';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Religion
after INSERT
ON SDSADM.STD_RELIGION
BEGIN
	-- update the table for STD_Religion operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Religion';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Religion
after UPDATE
ON SDSADM.STD_RELIGION
BEGIN
	-- update the table for STD_Religion operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Religion';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELIGION FOR SDSADM.STD_RELIGION;


ALTER TABLE SDSADM.STD_RELIGION ADD (
  CONSTRAINT PK_STD_RELIGION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELIGION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RELIGIONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_RELIGIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RELIGIONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_RELIGIONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELIGION TO ADR;

GRANT SELECT ON SDSADM.STD_RELIGION TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELIGION TO EESRV;

GRANT SELECT ON SDSADM.STD_RELIGION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELIGION TO LOBR;

GRANT SELECT ON SDSADM.STD_RELIGION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELIGION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELIGION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELIGION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELATNLOPERATORHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELATNLOPERATORHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELATNLOPERATORHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELATNLOPERATORHISTORY ON SDSADM.STD_RELATNLOPERATORHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RelatnlOperatorHstry
after DELETE
ON SDSADM.STD_RELATNLOPERATORHISTORY
BEGIN
	-- update the table for STD_RelatnlOperatorHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelatnlOperatorHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RelatnlOperatorHstry
after INSERT
ON SDSADM.STD_RELATNLOPERATORHISTORY
BEGIN
	-- update the table for STD_RelatnlOperatorHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelatnlOperatorHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RelatnlOperatorHstry
after UPDATE
ON SDSADM.STD_RELATNLOPERATORHISTORY
BEGIN
	-- update the table for STD_RelatnlOperatorHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelatnlOperatorHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELATNLOPERATORHISTORY FOR SDSADM.STD_RELATNLOPERATORHISTORY;


ALTER TABLE SDSADM.STD_RELATNLOPERATORHISTORY ADD (
  CONSTRAINT PK_STD_RELATNLOPERATORHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELATNLOPERATORHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_RELATNLOPERATORHISTORY ADD (
  CONSTRAINT FKSTD_RELATNLOPERATORHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_RELATIONALOPERATOR (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELATNLOPERATORHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_RELATNLOPERATORHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELATNLOPERATORHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_RELATNLOPERATORHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELATNLOPERATORHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_RELATNLOPERATORHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELATNLOPERATORHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELATNLOPERATORHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELATNLOPERATORHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELATNLCONJUNCTNHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELATNLCONJUNCTNHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELATNLCONJUNCTNHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELATNLCONJUNCTNHISTORY ON SDSADM.STD_RELATNLCONJUNCTNHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RelatnlConjunctnHstry
after DELETE
ON SDSADM.STD_RELATNLCONJUNCTNHISTORY
BEGIN
	-- update the table for STD_RelatnlConjunctnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelatnlConjunctnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RelatnlConjunctnHstry
after INSERT
ON SDSADM.STD_RELATNLCONJUNCTNHISTORY
BEGIN
	-- update the table for STD_RelatnlConjunctnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelatnlConjunctnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RelatnlConjunctnHstry
after UPDATE
ON SDSADM.STD_RELATNLCONJUNCTNHISTORY
BEGIN
	-- update the table for STD_RelatnlConjunctnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelatnlConjunctnHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELATNLCONJUNCTNHISTORY FOR SDSADM.STD_RELATNLCONJUNCTNHISTORY;


ALTER TABLE SDSADM.STD_RELATNLCONJUNCTNHISTORY ADD (
  CONSTRAINT PK_STD_RELATNLCONJUNCTNHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELATNLCONJUNCTNHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_RELATNLCONJUNCTNHISTORY ADD (
  CONSTRAINT FKSTD_RELATNLCNJNCTNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_RELATIONALCONJUNCTION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELATNLCONJUNCTNHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_RELATNLCONJUNCTNHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELATNLCONJUNCTNHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_RELATNLCONJUNCTNHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELATNLCONJUNCTNHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_RELATNLCONJUNCTNHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELATNLCONJUNCTNHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELATNLCONJUNCTNHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELATNLCONJUNCTNHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELATIONSHIPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELATIONSHIPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELATIONSHIPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELATIONSHIPHISTORY ON SDSADM.STD_RELATIONSHIPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RelationshipHistory
after DELETE
ON SDSADM.STD_RELATIONSHIPHISTORY
BEGIN
	-- update the table for STD_RelationshipHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelationshipHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RelationshipHistory
after INSERT
ON SDSADM.STD_RELATIONSHIPHISTORY
BEGIN
	-- update the table for STD_RelationshipHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelationshipHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RelationshipHistory
after UPDATE
ON SDSADM.STD_RELATIONSHIPHISTORY
BEGIN
	-- update the table for STD_RelationshipHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelationshipHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELATIONSHIPHISTORY FOR SDSADM.STD_RELATIONSHIPHISTORY;


ALTER TABLE SDSADM.STD_RELATIONSHIPHISTORY ADD (
  CONSTRAINT PK_STD_RELATIONSHIPHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELATIONSHIPHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_RELATIONSHIPHISTORY ADD (
  CONSTRAINT FKSTD_RELATIONSHIPHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_RELATIONSHIP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELATIONSHIPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_RELATIONSHIPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELATIONSHIPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_RELATIONSHIPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELATIONSHIPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_RELATIONSHIPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELATIONSHIPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELATIONSHIPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELATIONSHIPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELATIONSHIP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELATIONSHIP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELATIONSHIP
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELATIONSHIP ON SDSADM.STD_RELATIONSHIP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RELATIONSHIPCODE ON SDSADM.STD_RELATIONSHIP
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RELATIONSHIPNAME ON SDSADM.STD_RELATIONSHIP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Relationship
after DELETE
ON SDSADM.STD_RELATIONSHIP
BEGIN
	-- update the table for STD_Relationship operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Relationship';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Relationship
after INSERT
ON SDSADM.STD_RELATIONSHIP
BEGIN
	-- update the table for STD_Relationship operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Relationship';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Relationship
after UPDATE
ON SDSADM.STD_RELATIONSHIP
BEGIN
	-- update the table for STD_Relationship operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Relationship';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELATIONSHIP FOR SDSADM.STD_RELATIONSHIP;


ALTER TABLE SDSADM.STD_RELATIONSHIP ADD (
  CONSTRAINT PK_STD_RELATIONSHIP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELATIONSHIP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RELATIONSHIPCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_RELATIONSHIPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RELATIONSHIPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_RELATIONSHIPNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELATIONSHIP TO ADR;

GRANT SELECT ON SDSADM.STD_RELATIONSHIP TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELATIONSHIP TO EESRV;

GRANT SELECT ON SDSADM.STD_RELATIONSHIP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELATIONSHIP TO LOBR;

GRANT SELECT ON SDSADM.STD_RELATIONSHIP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELATIONSHIP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELATIONSHIP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELATIONSHIP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELATIONALOPERATOR
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELATIONALOPERATOR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELATIONALOPERATOR
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(25 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(150 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELATNLOPERATOR ON SDSADM.STD_RELATIONALOPERATOR
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RELATNLOPERATORCODE ON SDSADM.STD_RELATIONALOPERATOR
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RELATNLOPERATORNAME ON SDSADM.STD_RELATIONALOPERATOR
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RelatnlOperator
after DELETE
ON SDSADM.STD_RELATIONALOPERATOR
BEGIN
	-- update the table for STD_RelationalOperator operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelationalOperator';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RelatnlOperator
after INSERT
ON SDSADM.STD_RELATIONALOPERATOR
BEGIN
	-- update the table for STD_RelationalOperator operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelationalOperator';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RelatnlOperator
after UPDATE
ON SDSADM.STD_RELATIONALOPERATOR
BEGIN
	-- update the table for STD_RelationalOperator operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelationalOperator';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELATIONALOPERATOR FOR SDSADM.STD_RELATIONALOPERATOR;


ALTER TABLE SDSADM.STD_RELATIONALOPERATOR ADD (
  CONSTRAINT PK_STD_RELATNLOPERATOR
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELATNLOPERATOR
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RELATNLOPERATORCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_RELATNLOPERATORCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RELATNLOPERATORNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_RELATNLOPERATORNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELATIONALOPERATOR TO ADR;

GRANT SELECT ON SDSADM.STD_RELATIONALOPERATOR TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELATIONALOPERATOR TO EESRV;

GRANT SELECT ON SDSADM.STD_RELATIONALOPERATOR TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELATIONALOPERATOR TO LOBR;

GRANT SELECT ON SDSADM.STD_RELATIONALOPERATOR TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELATIONALOPERATOR TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELATIONALOPERATOR TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELATIONALOPERATOR TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RELATIONALCONJUNCTION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RELATIONALCONJUNCTION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RELATIONALCONJUNCTION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(25 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RELATNLCONJUNCTN ON SDSADM.STD_RELATIONALCONJUNCTION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RELATNLCONJUNCTNCODE ON SDSADM.STD_RELATIONALCONJUNCTION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RELATNLCONJUNCTNNAME ON SDSADM.STD_RELATIONALCONJUNCTION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RelatnlConjunctn
after DELETE
ON SDSADM.STD_RELATIONALCONJUNCTION
BEGIN
	-- update the table for STD_RelationalConjunction operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelationalConjunction';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RelatnlConjunctn
after INSERT
ON SDSADM.STD_RELATIONALCONJUNCTION
BEGIN
	-- update the table for STD_RelationalConjunction operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelationalConjunction';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RelatnlConjunctn
after UPDATE
ON SDSADM.STD_RELATIONALCONJUNCTION
BEGIN
	-- update the table for STD_RelationalConjunction operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RelationalConjunction';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RELATIONALCONJUNCTION FOR SDSADM.STD_RELATIONALCONJUNCTION;


ALTER TABLE SDSADM.STD_RELATIONALCONJUNCTION ADD (
  CONSTRAINT PK_STD_RELATNLCONJUNCTN
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RELATNLCONJUNCTN
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RELATNLCONJUNCTNCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_RELATNLCONJUNCTNCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RELATNLCONJUNCTNNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_RELATNLCONJUNCTNNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RELATIONALCONJUNCTION TO ADR;

GRANT SELECT ON SDSADM.STD_RELATIONALCONJUNCTION TO ADREXT;

GRANT SELECT ON SDSADM.STD_RELATIONALCONJUNCTION TO EESRV;

GRANT SELECT ON SDSADM.STD_RELATIONALCONJUNCTION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RELATIONALCONJUNCTION TO LOBR;

GRANT SELECT ON SDSADM.STD_RELATIONALCONJUNCTION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RELATIONALCONJUNCTION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RELATIONALCONJUNCTION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RELATIONALCONJUNCTION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_REJECTEDREMARKSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_REJECTEDREMARKSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_REJECTEDREMARKSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_REJECTEDREMARKSHISTORY ON SDSADM.STD_REJECTEDREMARKSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RejectedRemarksHstry
after DELETE
ON SDSADM.STD_REJECTEDREMARKSHISTORY
BEGIN
	-- update the table for STD_RejectedRemarksHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RejectedRemarksHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RejectedRemarksHstry
after INSERT
ON SDSADM.STD_REJECTEDREMARKSHISTORY
BEGIN
	-- update the table for STD_RejectedRemarksHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RejectedRemarksHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RejectedRemarksHstry
after UPDATE
ON SDSADM.STD_REJECTEDREMARKSHISTORY
BEGIN
	-- update the table for STD_RejectedRemarksHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RejectedRemarksHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_REJECTEDREMARKSHISTORY FOR SDSADM.STD_REJECTEDREMARKSHISTORY;


ALTER TABLE SDSADM.STD_REJECTEDREMARKSHISTORY ADD (
  CONSTRAINT PK_STD_REJECTEDREMARKSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_REJECTEDREMARKSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_REJECTEDREMARKSHISTORY ADD (
  CONSTRAINT FKSTD_REJECTEDREMARKSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_REJECTEDREMARKS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_REJECTEDREMARKSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_REJECTEDREMARKSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_REJECTEDREMARKSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_REJECTEDREMARKS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_REJECTEDREMARKS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_REJECTEDREMARKS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_REJECTEDREMARKS ON SDSADM.STD_REJECTEDREMARKS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_REJECTEDREMARKSCODE ON SDSADM.STD_REJECTEDREMARKS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_REJECTEDREMARKSNAME ON SDSADM.STD_REJECTEDREMARKS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RejectedRemarks
after DELETE
ON SDSADM.STD_REJECTEDREMARKS
BEGIN
	-- update the table for STD_RejectedRemarks operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RejectedRemarks';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RejectedRemarks
after INSERT
ON SDSADM.STD_REJECTEDREMARKS
BEGIN
	-- update the table for STD_RejectedRemarks operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RejectedRemarks';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RejectedRemarks
after UPDATE
ON SDSADM.STD_REJECTEDREMARKS
BEGIN
	-- update the table for STD_RejectedRemarks operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RejectedRemarks';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_REJECTEDREMARKS FOR SDSADM.STD_REJECTEDREMARKS;


ALTER TABLE SDSADM.STD_REJECTEDREMARKS ADD (
  CONSTRAINT PK_STD_REJECTEDREMARKS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_REJECTEDREMARKS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_REJECTEDREMARKSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_REJECTEDREMARKSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_REJECTEDREMARKSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_REJECTEDREMARKSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_REJECTEDREMARKS TO ADR;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKS TO ADREXT;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKS TO EESRV;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_REJECTEDREMARKS TO LOBR;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_REJECTEDREMARKS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_REJECTEDREMARKS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_REGISTRYTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_REGISTRYTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_REGISTRYTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_REGISTRYTYPEHISTORY ON SDSADM.STD_REGISTRYTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RegistryTypeHistory
after DELETE
ON SDSADM.STD_REGISTRYTYPEHISTORY
BEGIN
	-- update the table for STD_RegistryTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RegistryTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RegistryTypeHistory
after INSERT
ON SDSADM.STD_REGISTRYTYPEHISTORY
BEGIN
	-- update the table for STD_RegistryTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RegistryTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RegistryTypeHistory
after UPDATE
ON SDSADM.STD_REGISTRYTYPEHISTORY
BEGIN
	-- update the table for STD_RegistryTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RegistryTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_REGISTRYTYPEHISTORY FOR SDSADM.STD_REGISTRYTYPEHISTORY;


ALTER TABLE SDSADM.STD_REGISTRYTYPEHISTORY ADD (
  CONSTRAINT PK_STD_REGISTRYTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_REGISTRYTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_REGISTRYTYPEHISTORY ADD (
  CONSTRAINT FKSTD_REGISTRYTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_REGISTRYTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_REGISTRYTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_REGISTRYTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_REGISTRYTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_REGISTRYTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_REGISTRYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_REGISTRYTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_REGISTRYTYPE ON SDSADM.STD_REGISTRYTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_REGISTRYTYPECODE ON SDSADM.STD_REGISTRYTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RegistryType
after DELETE
ON SDSADM.STD_REGISTRYTYPE
BEGIN
	-- update the table for STD_RegistryType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RegistryType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RegistryType
after INSERT
ON SDSADM.STD_REGISTRYTYPE
BEGIN
	-- update the table for STD_RegistryType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RegistryType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RegistryType
after UPDATE
ON SDSADM.STD_REGISTRYTYPE
BEGIN
	-- update the table for STD_RegistryType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RegistryType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_REGISTRYTYPE FOR SDSADM.STD_REGISTRYTYPE;


ALTER TABLE SDSADM.STD_REGISTRYTYPE ADD (
  CONSTRAINT PK_STD_REGISTRYTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_REGISTRYTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_REGISTRYTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_REGISTRYTYPECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_REGISTRYTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_REGISTRYTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_REGISTRYTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_REGISTRYTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RADIATNEXPSRMTHDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RADIATNEXPSRMTHDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RADIATNEXPSRMTHDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RADIATNEXPSRMTHDHISTORY ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RadiatnExpsrMthdHstry
after DELETE
ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY
BEGIN
	-- update the table for STD_RadiatnExpsrMthdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RadiatnExpsrMthdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RadiatnExpsrMthdHstry
after INSERT
ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY
BEGIN
	-- update the table for STD_RadiatnExpsrMthdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RadiatnExpsrMthdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RadiatnExpsrMthdHstry
after UPDATE
ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY
BEGIN
	-- update the table for STD_RadiatnExpsrMthdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RadiatnExpsrMthdHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RADIATNEXPSRMTHDHISTORY FOR SDSADM.STD_RADIATNEXPSRMTHDHISTORY;


ALTER TABLE SDSADM.STD_RADIATNEXPSRMTHDHISTORY ADD (
  CONSTRAINT PK_STD_RADIATNEXPSRMTHDHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RADIATNEXPSRMTHDHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_RADIATNEXPSRMTHDHISTORY ADD (
  CONSTRAINT FKSTD_RDTNEXPSRMTHDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_RADIATIONEXPOSUREMETHOD (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RADIATNEXPSRMTHDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RADIATIONEXPOSUREMETHOD
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RADIATIONEXPOSUREMETHOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RADIATIONEXPOSUREMETHOD
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RADIATNEXPSRMTHD ON SDSADM.STD_RADIATIONEXPOSUREMETHOD
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RADIATNEXPSRMTHDCODE ON SDSADM.STD_RADIATIONEXPOSUREMETHOD
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RADIATNEXPSRMTHDNAME ON SDSADM.STD_RADIATIONEXPOSUREMETHOD
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RadiatnExpsrMthd
after DELETE
ON SDSADM.STD_RADIATIONEXPOSUREMETHOD
BEGIN
	-- update the table for STD_RadiationExposureMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RadiationExposureMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RadiatnExpsrMthd
after INSERT
ON SDSADM.STD_RADIATIONEXPOSUREMETHOD
BEGIN
	-- update the table for STD_RadiationExposureMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RadiationExposureMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RadiatnExpsrMthd
after UPDATE
ON SDSADM.STD_RADIATIONEXPOSUREMETHOD
BEGIN
	-- update the table for STD_RadiationExposureMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RadiationExposureMethod';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RADIATIONEXPOSUREMETHOD FOR SDSADM.STD_RADIATIONEXPOSUREMETHOD;


ALTER TABLE SDSADM.STD_RADIATIONEXPOSUREMETHOD ADD (
  CONSTRAINT PK_STD_RADIATNEXPSRMTHD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RADIATNEXPSRMTHD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RADIATNEXPSRMTHDCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_RADIATNEXPSRMTHDCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RADIATNEXPSRMTHDNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_RADIATNEXPSRMTHDNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RADIATIONEXPOSUREMETHOD TO ADR;

GRANT SELECT ON SDSADM.STD_RADIATIONEXPOSUREMETHOD TO ADREXT;

GRANT SELECT ON SDSADM.STD_RADIATIONEXPOSUREMETHOD TO EESRV;

GRANT SELECT ON SDSADM.STD_RADIATIONEXPOSUREMETHOD TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RADIATIONEXPOSUREMETHOD TO LOBR;

GRANT SELECT ON SDSADM.STD_RADIATIONEXPOSUREMETHOD TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RADIATIONEXPOSUREMETHOD TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RADIATIONEXPOSUREMETHOD TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RADIATIONEXPOSUREMETHOD TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RACEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RACEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RACEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RACEHISTORY ON SDSADM.STD_RACEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_RaceHistory
after DELETE
ON SDSADM.STD_RACEHISTORY
BEGIN
	-- update the table for STD_RaceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RaceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_RaceHistory
after INSERT
ON SDSADM.STD_RACEHISTORY
BEGIN
	-- update the table for STD_RaceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RaceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_RaceHistory
after UPDATE
ON SDSADM.STD_RACEHISTORY
BEGIN
	-- update the table for STD_RaceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_RaceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RACEHISTORY FOR SDSADM.STD_RACEHISTORY;


ALTER TABLE SDSADM.STD_RACEHISTORY ADD (
  CONSTRAINT PK_STD_RACEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RACEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_RACEHISTORY ADD (
  CONSTRAINT FKSTD_RACEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_RACE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RACEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_RACEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_RACEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_RACEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RACEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_RACEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RACEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RACEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RACEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_RACE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_RACE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_RACE
(
  ID           NUMBER(20)                       NOT NULL,
  HL7CODE      VARCHAR2(8 BYTE)                 NOT NULL,
  NAME         VARCHAR2(45 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_RACE ON SDSADM.STD_RACE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RACEHL7CODE ON SDSADM.STD_RACE
(HL7CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_RACENAME ON SDSADM.STD_RACE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Race
after DELETE
ON SDSADM.STD_RACE
BEGIN
	-- update the table for STD_Race operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Race';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Race
after INSERT
ON SDSADM.STD_RACE
BEGIN
	-- update the table for STD_Race operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Race';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Race
after UPDATE
ON SDSADM.STD_RACE
BEGIN
	-- update the table for STD_Race operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Race';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_RACE FOR SDSADM.STD_RACE;


ALTER TABLE SDSADM.STD_RACE ADD (
  CONSTRAINT PK_STD_RACE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_RACE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RACEHL7CODE
  UNIQUE (HL7CODE)
  USING INDEX SDSADM.UQSTD_RACEHL7CODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_RACENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_RACENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_RACE TO ADR;

GRANT SELECT ON SDSADM.STD_RACE TO ADREXT;

GRANT SELECT ON SDSADM.STD_RACE TO EESRV;

GRANT SELECT ON SDSADM.STD_RACE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_RACE TO LOBR;

GRANT REFERENCES, SELECT ON SDSADM.STD_RACE TO PATS;

GRANT REFERENCES, SELECT ON SDSADM.STD_RACE TO PATSRPTS;

GRANT SELECT ON SDSADM.STD_RACE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_RACE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_RACE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_RACE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PUBLICATIONTOPICHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PUBLICATIONTOPICHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PUBLICATIONTOPICHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PUBLICATIONTOPICHISTORY ON SDSADM.STD_PUBLICATIONTOPICHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PublicationTopicHstry
after DELETE
ON SDSADM.STD_PUBLICATIONTOPICHISTORY
BEGIN
	-- update the table for STD_PublicationTopicHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PublicationTopicHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PublicationTopicHstry
after INSERT
ON SDSADM.STD_PUBLICATIONTOPICHISTORY
BEGIN
	-- update the table for STD_PublicationTopicHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PublicationTopicHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PublicationTopicHstry
after UPDATE
ON SDSADM.STD_PUBLICATIONTOPICHISTORY
BEGIN
	-- update the table for STD_PublicationTopicHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PublicationTopicHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PUBLICATIONTOPICHISTORY FOR SDSADM.STD_PUBLICATIONTOPICHISTORY;


ALTER TABLE SDSADM.STD_PUBLICATIONTOPICHISTORY ADD (
  CONSTRAINT PK_STD_PUBLICATIONTOPICHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PUBLICATIONTOPICHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PUBLICATIONTOPICHISTORY ADD (
  CONSTRAINT FKSTD_PUBLICATIONTPCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PUBLICATIONTOPIC (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PUBLICATIONTOPICHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPICHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPICHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPICHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PUBLICATIONTOPICHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPICHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PUBLICATIONTOPICHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPICHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPICHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PUBLICATIONTOPIC
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PUBLICATIONTOPIC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PUBLICATIONTOPIC
(
  ID         NUMBER(20)                         NOT NULL,
  DATATYPE   VARCHAR2(256 BYTE)                 NOT NULL,
  TOPIC      VARCHAR2(256 BYTE)                 NOT NULL,
  VERSION    INTEGER                            NOT NULL,
  CREATED    TIMESTAMP(6)                       NOT NULL,
  UPDATED    TIMESTAMP(6),
  CREATEDBY  VARCHAR2(32 BYTE)                  NOT NULL,
  UPDATEDBY  VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PUBLICATIONTOPIC ON SDSADM.STD_PUBLICATIONTOPIC
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PUBLICATIONTOPICDATATYPE ON SDSADM.STD_PUBLICATIONTOPIC
(DATATYPE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PublicationTopic
after DELETE
ON SDSADM.STD_PUBLICATIONTOPIC
BEGIN
	-- update the table for STD_PublicationTopic operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PublicationTopic';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PublicationTopic
after INSERT
ON SDSADM.STD_PUBLICATIONTOPIC
BEGIN
	-- update the table for STD_PublicationTopic operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PublicationTopic';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PublicationTopic
after UPDATE
ON SDSADM.STD_PUBLICATIONTOPIC
BEGIN
	-- update the table for STD_PublicationTopic operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PublicationTopic';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PUBLICATIONTOPIC FOR SDSADM.STD_PUBLICATIONTOPIC;


ALTER TABLE SDSADM.STD_PUBLICATIONTOPIC ADD (
  CONSTRAINT PK_STD_PUBLICATIONTOPIC
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PUBLICATIONTOPIC
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PUBLICATIONTOPICDATATYPE
  UNIQUE (DATATYPE)
  USING INDEX SDSADM.UQSTD_PUBLICATIONTOPICDATATYPE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PUBLICATIONTOPIC TO ADR;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPIC TO ADREXT;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPIC TO EESRV;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPIC TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PUBLICATIONTOPIC TO LOBR;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPIC TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PUBLICATIONTOPIC TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPIC TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PUBLICATIONTOPIC TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PTFDISCHARGECODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PTFDISCHARGECODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PTFDISCHARGECODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PTFDISCHARGECODEHISTORY ON SDSADM.STD_PTFDISCHARGECODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PTFDischargeCodeHstry
after DELETE
ON SDSADM.STD_PTFDISCHARGECODEHISTORY
BEGIN
	-- update the table for STD_PTFDischargeCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PTFDischargeCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PTFDischargeCodeHstry
after INSERT
ON SDSADM.STD_PTFDISCHARGECODEHISTORY
BEGIN
	-- update the table for STD_PTFDischargeCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PTFDischargeCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PTFDischargeCodeHstry
after UPDATE
ON SDSADM.STD_PTFDISCHARGECODEHISTORY
BEGIN
	-- update the table for STD_PTFDischargeCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PTFDischargeCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PTFDISCHARGECODEHISTORY FOR SDSADM.STD_PTFDISCHARGECODEHISTORY;


ALTER TABLE SDSADM.STD_PTFDISCHARGECODEHISTORY ADD (
  CONSTRAINT PK_STD_PTFDISCHARGECODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PTFDISCHARGECODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PTFDISCHARGECODEHISTORY ADD (
  CONSTRAINT FKSTD_PTFDISCHARGECDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PTFDISCHARGECODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PTFDISCHARGECODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PTFDISCHARGECODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PTFDISCHARGECODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PTFDISCHARGECODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PTFDISCHARGECODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PTFDISCHARGECODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PTFDISCHARGECODE ON SDSADM.STD_PTFDISCHARGECODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PTFDISCHARGECODECODE ON SDSADM.STD_PTFDISCHARGECODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PTFDISCHARGECODENAME ON SDSADM.STD_PTFDISCHARGECODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PTFDischargeCode
after DELETE
ON SDSADM.STD_PTFDISCHARGECODE
BEGIN
	-- update the table for STD_PTFDischargeCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PTFDischargeCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PTFDischargeCode
after INSERT
ON SDSADM.STD_PTFDISCHARGECODE
BEGIN
	-- update the table for STD_PTFDischargeCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PTFDischargeCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PTFDischargeCode
after UPDATE
ON SDSADM.STD_PTFDISCHARGECODE
BEGIN
	-- update the table for STD_PTFDischargeCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PTFDischargeCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PTFDISCHARGECODE FOR SDSADM.STD_PTFDISCHARGECODE;


ALTER TABLE SDSADM.STD_PTFDISCHARGECODE ADD (
  CONSTRAINT PK_STD_PTFDISCHARGECODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PTFDISCHARGECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PTFDISCHARGECODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PTFDISCHARGECODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PTFDISCHARGECODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PTFDISCHARGECODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PTFDISCHARGECODE TO ADR;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODE TO EESRV;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PTFDISCHARGECODE TO LOBR;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PTFDISCHARGECODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PTFDISCHARGECODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PSEUDOSSNREASONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PSEUDOSSNREASONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PSEUDOSSNREASONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PSEUDOSSNREASONHISTORY ON SDSADM.STD_PSEUDOSSNREASONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PseudoSSNReasonHstry
after DELETE
ON SDSADM.STD_PSEUDOSSNREASONHISTORY
BEGIN
	-- update the table for STD_PseudoSSNReasonHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PseudoSSNReasonHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PseudoSSNReasonHstry
after INSERT
ON SDSADM.STD_PSEUDOSSNREASONHISTORY
BEGIN
	-- update the table for STD_PseudoSSNReasonHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PseudoSSNReasonHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PseudoSSNReasonHstry
after UPDATE
ON SDSADM.STD_PSEUDOSSNREASONHISTORY
BEGIN
	-- update the table for STD_PseudoSSNReasonHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PseudoSSNReasonHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PSEUDOSSNREASONHISTORY FOR SDSADM.STD_PSEUDOSSNREASONHISTORY;


ALTER TABLE SDSADM.STD_PSEUDOSSNREASONHISTORY ADD (
  CONSTRAINT PK_STD_PSEUDOSSNREASONHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PSEUDOSSNREASONHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PSEUDOSSNREASONHISTORY ADD (
  CONSTRAINT FKSTD_PSEUDOSSNREASONHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PSEUDOSSNREASON (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PSEUDOSSNREASONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PSEUDOSSNREASONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PSEUDOSSNREASONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PSEUDOSSNREASON
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PSEUDOSSNREASON CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PSEUDOSSNREASON
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PSEUDOSSNREASON ON SDSADM.STD_PSEUDOSSNREASON
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PSEUDOSSNREASONCODE ON SDSADM.STD_PSEUDOSSNREASON
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PSEUDOSSNREASONNAME ON SDSADM.STD_PSEUDOSSNREASON
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PseudoSSNReason
after DELETE
ON SDSADM.STD_PSEUDOSSNREASON
BEGIN
	-- update the table for STD_PseudoSSNReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PseudoSSNReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PseudoSSNReason
after INSERT
ON SDSADM.STD_PSEUDOSSNREASON
BEGIN
	-- update the table for STD_PseudoSSNReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PseudoSSNReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PseudoSSNReason
after UPDATE
ON SDSADM.STD_PSEUDOSSNREASON
BEGIN
	-- update the table for STD_PseudoSSNReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PseudoSSNReason';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PSEUDOSSNREASON FOR SDSADM.STD_PSEUDOSSNREASON;


ALTER TABLE SDSADM.STD_PSEUDOSSNREASON ADD (
  CONSTRAINT PK_STD_PSEUDOSSNREASON
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PSEUDOSSNREASON
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PSEUDOSSNREASONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PSEUDOSSNREASONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PSEUDOSSNREASONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PSEUDOSSNREASONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PSEUDOSSNREASON TO ADR;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASON TO ADREXT;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASON TO EESRV;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASON TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PSEUDOSSNREASON TO LOBR;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASON TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PSEUDOSSNREASON TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASON TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PSEUDOSSNREASON TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PROGRAMOFSTUDYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PROGRAMOFSTUDYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PROGRAMOFSTUDYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PROGRAMOFSTUDYHISTORY ON SDSADM.STD_PROGRAMOFSTUDYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ProgramOfStudyHistory
after DELETE
ON SDSADM.STD_PROGRAMOFSTUDYHISTORY
BEGIN
	-- update the table for STD_ProgramOfStudyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProgramOfStudyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ProgramOfStudyHistory
after INSERT
ON SDSADM.STD_PROGRAMOFSTUDYHISTORY
BEGIN
	-- update the table for STD_ProgramOfStudyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProgramOfStudyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ProgramOfStudyHistory
after UPDATE
ON SDSADM.STD_PROGRAMOFSTUDYHISTORY
BEGIN
	-- update the table for STD_ProgramOfStudyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProgramOfStudyHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PROGRAMOFSTUDYHISTORY FOR SDSADM.STD_PROGRAMOFSTUDYHISTORY;


ALTER TABLE SDSADM.STD_PROGRAMOFSTUDYHISTORY ADD (
  CONSTRAINT PK_STD_PROGRAMOFSTUDYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PROGRAMOFSTUDYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PROGRAMOFSTUDYHISTORY ADD (
  CONSTRAINT FKSTD_PROGRAMOFSTUDYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PROGRAMOFSTUDY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PROGRAMOFSTUDYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PROGRAMOFSTUDYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PROGRAMOFSTUDYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PROGRAMOFSTUDY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PROGRAMOFSTUDY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PROGRAMOFSTUDY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(10 BYTE)                NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(150 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PROGRAMOFSTUDY ON SDSADM.STD_PROGRAMOFSTUDY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PROGRAMOFSTUDYCODE ON SDSADM.STD_PROGRAMOFSTUDY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PROGRAMOFSTUDYNAME ON SDSADM.STD_PROGRAMOFSTUDY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ProgramOfStudy
after DELETE
ON SDSADM.STD_PROGRAMOFSTUDY
BEGIN
	-- update the table for STD_ProgramOfStudy operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProgramOfStudy';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ProgramOfStudy
after INSERT
ON SDSADM.STD_PROGRAMOFSTUDY
BEGIN
	-- update the table for STD_ProgramOfStudy operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProgramOfStudy';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ProgramOfStudy
after UPDATE
ON SDSADM.STD_PROGRAMOFSTUDY
BEGIN
	-- update the table for STD_ProgramOfStudy operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProgramOfStudy';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PROGRAMOFSTUDY FOR SDSADM.STD_PROGRAMOFSTUDY;


ALTER TABLE SDSADM.STD_PROGRAMOFSTUDY ADD (
  CONSTRAINT PK_STD_PROGRAMOFSTUDY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PROGRAMOFSTUDY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PROGRAMOFSTUDYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PROGRAMOFSTUDYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PROGRAMOFSTUDYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PROGRAMOFSTUDYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PROGRAMOFSTUDY TO ADR;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDY TO EESRV;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PROGRAMOFSTUDY TO LOBR;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PROGRAMOFSTUDY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PROGRAMOFSTUDY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PROCEDURECODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PROCEDURECODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PROCEDURECODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PROCEDURECODEHISTORY ON SDSADM.STD_PROCEDURECODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ProcedureCodeHistory
after DELETE
ON SDSADM.STD_PROCEDURECODEHISTORY
BEGIN
	-- update the table for STD_ProcedureCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProcedureCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ProcedureCodeHistory
after INSERT
ON SDSADM.STD_PROCEDURECODEHISTORY
BEGIN
	-- update the table for STD_ProcedureCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProcedureCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ProcedureCodeHistory
after UPDATE
ON SDSADM.STD_PROCEDURECODEHISTORY
BEGIN
	-- update the table for STD_ProcedureCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProcedureCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PROCEDURECODEHISTORY FOR SDSADM.STD_PROCEDURECODEHISTORY;


ALTER TABLE SDSADM.STD_PROCEDURECODEHISTORY ADD (
  CONSTRAINT PK_STD_PROCEDURECODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PROCEDURECODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PROCEDURECODEHISTORY ADD (
  CONSTRAINT FKSTD_PROCEDURECODEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PROCEDURECODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PROCEDURECODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PROCEDURECODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PROCEDURECODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PROCEDURECODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PROCEDURECODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PROCEDURECODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PROCEDURECODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PROCEDURECODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PROCEDURECODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PROCEDURECODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PROCEDURECODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PROCEDURECODE
(
  ID            NUMBER(20)                      NOT NULL,
  CODE          VARCHAR2(50 BYTE)               NOT NULL,
  NAME          VARCHAR2(60 BYTE)               NOT NULL,
  CODESET_TYPE  VARCHAR2(6 BYTE)                NOT NULL,
  DESCRIPTION   VARCHAR2(100 BYTE),
  VERSION       INTEGER                         NOT NULL,
  CREATED       TIMESTAMP(6)                    NOT NULL,
  UPDATED       TIMESTAMP(6),
  CREATEDBY     VARCHAR2(32 BYTE)               NOT NULL,
  UPDATEDBY     VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PROCEDURECODE ON SDSADM.STD_PROCEDURECODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PROCEDURECODECODE ON SDSADM.STD_PROCEDURECODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ProcedureCode
after DELETE
ON SDSADM.STD_PROCEDURECODE
BEGIN
	-- update the table for STD_ProcedureCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProcedureCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ProcedureCode
after INSERT
ON SDSADM.STD_PROCEDURECODE
BEGIN
	-- update the table for STD_ProcedureCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProcedureCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ProcedureCode
after UPDATE
ON SDSADM.STD_PROCEDURECODE
BEGIN
	-- update the table for STD_ProcedureCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ProcedureCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PROCEDURECODE FOR SDSADM.STD_PROCEDURECODE;


ALTER TABLE SDSADM.STD_PROCEDURECODE ADD (
  CONSTRAINT PK_STD_PROCEDURECODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PROCEDURECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PROCEDURECODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PROCEDURECODECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PROCEDURECODE TO ADR;

GRANT SELECT ON SDSADM.STD_PROCEDURECODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PROCEDURECODE TO EESRV;

GRANT SELECT ON SDSADM.STD_PROCEDURECODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PROCEDURECODE TO LOBR;

GRANT SELECT ON SDSADM.STD_PROCEDURECODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PROCEDURECODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PROCEDURECODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PROCEDURECODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PRIMCARETMPURPCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PRIMCARETMPURPCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PRIMCARETMPURPCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PRIMCARETMPURPCODEHSTRY ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PrimCareTmPurpCdHstry
after DELETE
ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY
BEGIN
	-- update the table for STD_PrimCareTmPurpCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrimCareTmPurpCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PrimCareTmPurpCdHstry
after INSERT
ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY
BEGIN
	-- update the table for STD_PrimCareTmPurpCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrimCareTmPurpCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PrimCareTmPurpCdHstry
after UPDATE
ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY
BEGIN
	-- update the table for STD_PrimCareTmPurpCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrimCareTmPurpCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PRIMCARETMPURPCODEHISTORY FOR SDSADM.STD_PRIMCARETMPURPCODEHISTORY;


ALTER TABLE SDSADM.STD_PRIMCARETMPURPCODEHISTORY ADD (
  CONSTRAINT PK_STD_PRIMCARETMPURPCODEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PRIMCARETMPURPCODEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PRIMCARETMPURPCODEHISTORY ADD (
  CONSTRAINT FKSTD_PRIMCARETMPRPCDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PRIMCARETMPURPCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PRIMCARETMPURPCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PRIMCARETMPURPCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PRIMCARETMPURPCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(35 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(200 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PRIMCARETMPURPCODE ON SDSADM.STD_PRIMCARETMPURPCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PRIMCARETMPURPCODECODE ON SDSADM.STD_PRIMCARETMPURPCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PRIMCARETMPURPCODENAME ON SDSADM.STD_PRIMCARETMPURPCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PrimCareTmPurpCode
after DELETE
ON SDSADM.STD_PRIMCARETMPURPCODE
BEGIN
	-- update the table for STD_PrimCareTmPurpCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrimCareTmPurpCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PrimCareTmPurpCode
after INSERT
ON SDSADM.STD_PRIMCARETMPURPCODE
BEGIN
	-- update the table for STD_PrimCareTmPurpCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrimCareTmPurpCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PrimCareTmPurpCode
after UPDATE
ON SDSADM.STD_PRIMCARETMPURPCODE
BEGIN
	-- update the table for STD_PrimCareTmPurpCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrimCareTmPurpCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PRIMCARETMPURPCODE FOR SDSADM.STD_PRIMCARETMPURPCODE;


ALTER TABLE SDSADM.STD_PRIMCARETMPURPCODE ADD (
  CONSTRAINT PK_STD_PRIMCARETMPURPCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PRIMCARETMPURPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PRIMCARETMPURPCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PRIMCARETMPURPCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PRIMCARETMPURPCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PRIMCARETMPURPCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PRIMCARETMPURPCODE TO ADR;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PRIMCARETMPURPCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PRIMCARETMPURPCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PRIMCARETMPURPCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PREFFACSRCDESIGHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PREFFACSRCDESIGHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PREFFACSRCDESIGHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PREFFACSRCDESIGHISTORY ON SDSADM.STD_PREFFACSRCDESIGHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PrefFacSrcDesigHstry
after DELETE
ON SDSADM.STD_PREFFACSRCDESIGHISTORY
BEGIN
	-- update the table for STD_PrefFacSrcDesigHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrefFacSrcDesigHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PrefFacSrcDesigHstry
after INSERT
ON SDSADM.STD_PREFFACSRCDESIGHISTORY
BEGIN
	-- update the table for STD_PrefFacSrcDesigHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrefFacSrcDesigHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PrefFacSrcDesigHstry
after UPDATE
ON SDSADM.STD_PREFFACSRCDESIGHISTORY
BEGIN
	-- update the table for STD_PrefFacSrcDesigHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrefFacSrcDesigHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PREFFACSRCDESIGHISTORY FOR SDSADM.STD_PREFFACSRCDESIGHISTORY;


ALTER TABLE SDSADM.STD_PREFFACSRCDESIGHISTORY ADD (
  CONSTRAINT PK_STD_PREFFACSRCDESIGHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PREFFACSRCDESIGHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PREFFACSRCDESIGHISTORY ADD (
  CONSTRAINT FKSTD_PREFFACSRCDESIGHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PREFFACSRCDESIG (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PREFFACSRCDESIGHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIGHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIGHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIGHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PREFFACSRCDESIGHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIGHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PREFFACSRCDESIGHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIGHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIGHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PREFFACSRCDESIG
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PREFFACSRCDESIG CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PREFFACSRCDESIG
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PREFFACSRCDESIG ON SDSADM.STD_PREFFACSRCDESIG
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PREFFACSRCDESIGCODE ON SDSADM.STD_PREFFACSRCDESIG
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PREFFACSRCDESIGNAME ON SDSADM.STD_PREFFACSRCDESIG
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PrefFacSrcDesig
after DELETE
ON SDSADM.STD_PREFFACSRCDESIG
BEGIN
	-- update the table for STD_PrefFacSrcDesig operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrefFacSrcDesig';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PrefFacSrcDesig
after INSERT
ON SDSADM.STD_PREFFACSRCDESIG
BEGIN
	-- update the table for STD_PrefFacSrcDesig operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrefFacSrcDesig';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PrefFacSrcDesig
after UPDATE
ON SDSADM.STD_PREFFACSRCDESIG
BEGIN
	-- update the table for STD_PrefFacSrcDesig operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PrefFacSrcDesig';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PREFFACSRCDESIG FOR SDSADM.STD_PREFFACSRCDESIG;


ALTER TABLE SDSADM.STD_PREFFACSRCDESIG ADD (
  CONSTRAINT PK_STD_PREFFACSRCDESIG
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PREFFACSRCDESIG
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PREFFACSRCDESIGCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PREFFACSRCDESIGCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PREFFACSRCDESIGNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PREFFACSRCDESIGNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PREFFACSRCDESIG TO ADR;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIG TO ADREXT;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIG TO EESRV;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIG TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PREFFACSRCDESIG TO LOBR;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIG TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PREFFACSRCDESIG TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIG TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PREFFACSRCDESIG TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWPERIODHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWPERIODHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWPERIODHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWPERIODHISTORY ON SDSADM.STD_POWPERIODHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_POWPeriodHistory
after DELETE
ON SDSADM.STD_POWPERIODHISTORY
BEGIN
	-- update the table for STD_POWPeriodHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWPeriodHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_POWPeriodHistory
after INSERT
ON SDSADM.STD_POWPERIODHISTORY
BEGIN
	-- update the table for STD_POWPeriodHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWPeriodHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_POWPeriodHistory
after UPDATE
ON SDSADM.STD_POWPERIODHISTORY
BEGIN
	-- update the table for STD_POWPeriodHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWPeriodHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWPERIODHISTORY FOR SDSADM.STD_POWPERIODHISTORY;


ALTER TABLE SDSADM.STD_POWPERIODHISTORY ADD (
  CONSTRAINT PK_STD_POWPERIODHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWPERIODHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_POWPERIODHISTORY ADD (
  CONSTRAINT FKSTD_POWPERIODHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_POWPERIOD (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWPERIODHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_POWPERIODHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWPERIODHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_POWPERIODHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWPERIODHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_POWPERIODHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWPERIODHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWPERIODHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWPERIODHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWPERIOD
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWPERIOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWPERIOD
(
  ID             NUMBER(20)                     NOT NULL,
  CODE           CHAR(1 BYTE)                   NOT NULL,
  NAME           VARCHAR2(30 BYTE)              NOT NULL,
  ALTERNATENAME  VARCHAR2(14 BYTE)              NOT NULL,
  SHORTENEDNAME  VARCHAR2(28 BYTE)              NOT NULL,
  VERSION        INTEGER                        NOT NULL,
  CREATED        TIMESTAMP(6)                   NOT NULL,
  UPDATED        TIMESTAMP(6),
  CREATEDBY      VARCHAR2(32 BYTE)              NOT NULL,
  UPDATEDBY      VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWPERIOD ON SDSADM.STD_POWPERIOD
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_POWPERIODCODE ON SDSADM.STD_POWPERIOD
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_POWPeriod
after DELETE
ON SDSADM.STD_POWPERIOD
BEGIN
	-- update the table for STD_POWPeriod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWPeriod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_POWPeriod
after INSERT
ON SDSADM.STD_POWPERIOD
BEGIN
	-- update the table for STD_POWPeriod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWPeriod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_POWPeriod
after UPDATE
ON SDSADM.STD_POWPERIOD
BEGIN
	-- update the table for STD_POWPeriod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWPeriod';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWPERIOD FOR SDSADM.STD_POWPERIOD;


ALTER TABLE SDSADM.STD_POWPERIOD ADD (
  CONSTRAINT PK_STD_POWPERIOD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWPERIOD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_POWPERIODCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_POWPERIODCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWPERIOD TO ADR;

GRANT SELECT ON SDSADM.STD_POWPERIOD TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWPERIOD TO EESRV;

GRANT SELECT ON SDSADM.STD_POWPERIOD TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWPERIOD TO LOBR;

GRANT SELECT ON SDSADM.STD_POWPERIOD TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWPERIOD TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWPERIOD TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWPERIOD TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWDOCUMENTTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWDOCUMENTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWDOCUMENTTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWDOCUMENTTYPEHISTORY ON SDSADM.STD_POWDOCUMENTTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_POWDocumentTypeHstry
after DELETE
ON SDSADM.STD_POWDOCUMENTTYPEHISTORY
BEGIN
	-- update the table for STD_POWDocumentTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDocumentTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_POWDocumentTypeHstry
after INSERT
ON SDSADM.STD_POWDOCUMENTTYPEHISTORY
BEGIN
	-- update the table for STD_POWDocumentTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDocumentTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_POWDocumentTypeHstry
after UPDATE
ON SDSADM.STD_POWDOCUMENTTYPEHISTORY
BEGIN
	-- update the table for STD_POWDocumentTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDocumentTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWDOCUMENTTYPEHISTORY FOR SDSADM.STD_POWDOCUMENTTYPEHISTORY;


ALTER TABLE SDSADM.STD_POWDOCUMENTTYPEHISTORY ADD (
  CONSTRAINT PK_STD_POWDOCUMENTTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWDOCUMENTTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_POWDOCUMENTTYPEHISTORY ADD (
  CONSTRAINT FKSTD_POWDOCUMENTTYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_POWDOCUMENTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWDOCUMENTTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWDOCUMENTTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWDOCUMENTTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWDOCUMENTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWDOCUMENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWDOCUMENTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWDOCUMENTTYPE ON SDSADM.STD_POWDOCUMENTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_POWDOCUMENTTYPECODE ON SDSADM.STD_POWDOCUMENTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_POWDocumentType
after DELETE
ON SDSADM.STD_POWDOCUMENTTYPE
BEGIN
	-- update the table for STD_POWDocumentType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDocumentType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_POWDocumentType
after INSERT
ON SDSADM.STD_POWDOCUMENTTYPE
BEGIN
	-- update the table for STD_POWDocumentType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDocumentType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_POWDocumentType
after UPDATE
ON SDSADM.STD_POWDOCUMENTTYPE
BEGIN
	-- update the table for STD_POWDocumentType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDocumentType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWDOCUMENTTYPE FOR SDSADM.STD_POWDOCUMENTTYPE;


ALTER TABLE SDSADM.STD_POWDOCUMENTTYPE ADD (
  CONSTRAINT PK_STD_POWDOCUMENTTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWDOCUMENTTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_POWDOCUMENTTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_POWDOCUMENTTYPECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWDOCUMENTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWDOCUMENTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWDOCUMENTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWDOCUMENTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWDATASOURCETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWDATASOURCETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWDATASOURCETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWDATASOURCETYPEHSTRY ON SDSADM.STD_POWDATASOURCETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_POWDataSourceTypHstry
after DELETE
ON SDSADM.STD_POWDATASOURCETYPEHISTORY
BEGIN
	-- update the table for STD_POWDataSourceTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDataSourceTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_POWDataSourceTypHstry
after INSERT
ON SDSADM.STD_POWDATASOURCETYPEHISTORY
BEGIN
	-- update the table for STD_POWDataSourceTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDataSourceTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_POWDataSourceTypHstry
after UPDATE
ON SDSADM.STD_POWDATASOURCETYPEHISTORY
BEGIN
	-- update the table for STD_POWDataSourceTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDataSourceTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWDATASOURCETYPEHISTORY FOR SDSADM.STD_POWDATASOURCETYPEHISTORY;


ALTER TABLE SDSADM.STD_POWDATASOURCETYPEHISTORY ADD (
  CONSTRAINT PK_STD_POWDATASOURCETYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWDATASOURCETYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_POWDATASOURCETYPEHISTORY ADD (
  CONSTRAINT FKSTD_POWDATASRCTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_POWDATASOURCETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWDATASOURCETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWDATASOURCETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWDATASOURCETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWDATASOURCETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWDATASOURCETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWDATASOURCETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(10 BYTE)                NOT NULL,
  NAME         VARCHAR2(60 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWDATASOURCETYPE ON SDSADM.STD_POWDATASOURCETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_POWDATASOURCETYPECODE ON SDSADM.STD_POWDATASOURCETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_POWDATASOURCETYPENAME ON SDSADM.STD_POWDATASOURCETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_POWDataSourceType
after DELETE
ON SDSADM.STD_POWDATASOURCETYPE
BEGIN
	-- update the table for STD_POWDataSourceType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDataSourceType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_POWDataSourceType
after INSERT
ON SDSADM.STD_POWDATASOURCETYPE
BEGIN
	-- update the table for STD_POWDataSourceType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDataSourceType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_POWDataSourceType
after UPDATE
ON SDSADM.STD_POWDATASOURCETYPE
BEGIN
	-- update the table for STD_POWDataSourceType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWDataSourceType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWDATASOURCETYPE FOR SDSADM.STD_POWDATASOURCETYPE;


ALTER TABLE SDSADM.STD_POWDATASOURCETYPE ADD (
  CONSTRAINT PK_STD_POWDATASOURCETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWDATASOURCETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_POWDATASOURCETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_POWDATASOURCETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_POWDATASOURCETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_POWDATASOURCETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWDATASOURCETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWDATASOURCETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWDATASOURCETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWDATASOURCETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWCONFINELOCNTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWCONFINELOCNTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWCONFINELOCNTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWCONFINELOCNTYPEHSTRY ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_POWConfineLcnTypHstry
after DELETE
ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY
BEGIN
	-- update the table for STD_POWConfineLocnTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWConfineLocnTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_POWConfineLcnTypHstry
after INSERT
ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY
BEGIN
	-- update the table for STD_POWConfineLocnTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWConfineLocnTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_POWConfineLcnTypHstry
after UPDATE
ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY
BEGIN
	-- update the table for STD_POWConfineLocnTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWConfineLocnTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWCONFINELOCNTYPEHISTORY FOR SDSADM.STD_POWCONFINELOCNTYPEHISTORY;


ALTER TABLE SDSADM.STD_POWCONFINELOCNTYPEHISTORY ADD (
  CONSTRAINT PK_STD_POWCONFINELOCNTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWCONFINELOCNTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_POWCONFINELOCNTYPEHISTORY ADD (
  CONSTRAINT FKSTD_POWCNFNLCNTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_POWCONFINELOCNTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWCONFINELOCNTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWCONFINELOCNTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWCONFINELOCNTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWCONFINELOCNTYPE ON SDSADM.STD_POWCONFINELOCNTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_POWCONFINELOCNTYPECODE ON SDSADM.STD_POWCONFINELOCNTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_POWConfineLocnType
after DELETE
ON SDSADM.STD_POWCONFINELOCNTYPE
BEGIN
	-- update the table for STD_POWConfineLocnType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWConfineLocnType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_POWConfineLocnType
after INSERT
ON SDSADM.STD_POWCONFINELOCNTYPE
BEGIN
	-- update the table for STD_POWConfineLocnType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWConfineLocnType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_POWConfineLocnType
after UPDATE
ON SDSADM.STD_POWCONFINELOCNTYPE
BEGIN
	-- update the table for STD_POWConfineLocnType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_POWConfineLocnType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWCONFINELOCNTYPE FOR SDSADM.STD_POWCONFINELOCNTYPE;


ALTER TABLE SDSADM.STD_POWCONFINELOCNTYPE ADD (
  CONSTRAINT PK_STD_POWCONFINELOCNTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWCONFINELOCNTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_POWCONFINELOCNTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_POWCONFINELOCNTYPECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWCONFINELOCNTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWCONFINELOCNTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWCONFINELOCNTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWCONFINELOCNTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWCASUALTYLOCATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWCASUALTYLOCATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWCASUALTYLOCATION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(60 BYTE)                NOT NULL,
  LOCATION     VARCHAR2(60 BYTE),
  CITY         VARCHAR2(60 BYTE),
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWCASLOCN ON SDSADM.STD_POWCASUALTYLOCATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_POWCASLOCNCODE ON SDSADM.STD_POWCASUALTYLOCATION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PowCasLocn
after DELETE
ON SDSADM.STD_POWCASUALTYLOCATION
BEGIN
	-- update the table for STD_PowCasualtyLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PowCasualtyLocation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PowCasLocn
after INSERT
ON SDSADM.STD_POWCASUALTYLOCATION
BEGIN
	-- update the table for STD_PowCasualtyLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PowCasualtyLocation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PowCasLocn
after UPDATE
ON SDSADM.STD_POWCASUALTYLOCATION
BEGIN
	-- update the table for STD_PowCasualtyLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PowCasualtyLocation';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWCASUALTYLOCATION FOR SDSADM.STD_POWCASUALTYLOCATION;


ALTER TABLE SDSADM.STD_POWCASUALTYLOCATION ADD (
  CONSTRAINT PK_STD_POWCASLOCN
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWCASLOCN
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_POWCASLOCNCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_POWCASLOCNCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWCASUALTYLOCATION TO ADR;

GRANT SELECT ON SDSADM.STD_POWCASUALTYLOCATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWCASUALTYLOCATION TO EESRV;

GRANT SELECT ON SDSADM.STD_POWCASUALTYLOCATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWCASUALTYLOCATION TO LOBR;

GRANT SELECT ON SDSADM.STD_POWCASUALTYLOCATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWCASUALTYLOCATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWCASUALTYLOCATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWCASUALTYLOCATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POWCASLOCNHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POWCASLOCNHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POWCASLOCNHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POWCASLOCNHISTORY ON SDSADM.STD_POWCASLOCNHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PowCasLocnHistory
after DELETE
ON SDSADM.STD_POWCASLOCNHISTORY
BEGIN
	-- update the table for STD_PowCasLocnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PowCasLocnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PowCasLocnHistory
after INSERT
ON SDSADM.STD_POWCASLOCNHISTORY
BEGIN
	-- update the table for STD_PowCasLocnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PowCasLocnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PowCasLocnHistory
after UPDATE
ON SDSADM.STD_POWCASLOCNHISTORY
BEGIN
	-- update the table for STD_PowCasLocnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PowCasLocnHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POWCASLOCNHISTORY FOR SDSADM.STD_POWCASLOCNHISTORY;


ALTER TABLE SDSADM.STD_POWCASLOCNHISTORY ADD (
  CONSTRAINT PK_STD_POWCASLOCNHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POWCASLOCNHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_POWCASLOCNHISTORY ADD (
  CONSTRAINT FKSTD_POWCASLOCNHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_POWCASUALTYLOCATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POWCASLOCNHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_POWCASLOCNHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_POWCASLOCNHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_POWCASLOCNHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POWCASLOCNHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_POWCASLOCNHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POWCASLOCNHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POWCASLOCNHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POWCASLOCNHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POLICYHOLDERTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POLICYHOLDERTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POLICYHOLDERTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POLICYHOLDERTYPEHISTORY ON SDSADM.STD_POLICYHOLDERTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PolicyHolderTypeHstry
after DELETE
ON SDSADM.STD_POLICYHOLDERTYPEHISTORY
BEGIN
	-- update the table for STD_PolicyHolderTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PolicyHolderTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PolicyHolderTypeHstry
after INSERT
ON SDSADM.STD_POLICYHOLDERTYPEHISTORY
BEGIN
	-- update the table for STD_PolicyHolderTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PolicyHolderTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PolicyHolderTypeHstry
after UPDATE
ON SDSADM.STD_POLICYHOLDERTYPEHISTORY
BEGIN
	-- update the table for STD_PolicyHolderTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PolicyHolderTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POLICYHOLDERTYPEHISTORY FOR SDSADM.STD_POLICYHOLDERTYPEHISTORY;


ALTER TABLE SDSADM.STD_POLICYHOLDERTYPEHISTORY ADD (
  CONSTRAINT PK_STD_POLICYHOLDERTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POLICYHOLDERTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_POLICYHOLDERTYPEHISTORY ADD (
  CONSTRAINT FKSTD_POLICYHOLDERTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_POLICYHOLDERTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POLICYHOLDERTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POLICYHOLDERTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POLICYHOLDERTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_POLICYHOLDERTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_POLICYHOLDERTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_POLICYHOLDERTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_POLICYHOLDERTYPE ON SDSADM.STD_POLICYHOLDERTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_POLICYHOLDERTYPECODE ON SDSADM.STD_POLICYHOLDERTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PolicyHolderType
after DELETE
ON SDSADM.STD_POLICYHOLDERTYPE
BEGIN
	-- update the table for STD_PolicyHolderType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PolicyHolderType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PolicyHolderType
after INSERT
ON SDSADM.STD_POLICYHOLDERTYPE
BEGIN
	-- update the table for STD_PolicyHolderType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PolicyHolderType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PolicyHolderType
after UPDATE
ON SDSADM.STD_POLICYHOLDERTYPE
BEGIN
	-- update the table for STD_PolicyHolderType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PolicyHolderType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_POLICYHOLDERTYPE FOR SDSADM.STD_POLICYHOLDERTYPE;


ALTER TABLE SDSADM.STD_POLICYHOLDERTYPE ADD (
  CONSTRAINT PK_STD_POLICYHOLDERTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_POLICYHOLDERTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_POLICYHOLDERTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_POLICYHOLDERTYPECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_POLICYHOLDERTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_POLICYHOLDERTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_POLICYHOLDERTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_POLICYHOLDERTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PLANCATEGORYTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PLANCATEGORYTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PLANCATEGORYTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PLANCATEGORYTYPEHISTORY ON SDSADM.STD_PLANCATEGORYTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PlanCategoryTypeHstry
after DELETE
ON SDSADM.STD_PLANCATEGORYTYPEHISTORY
BEGIN
	-- update the table for STD_PlanCategoryTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlanCategoryTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PlanCategoryTypeHstry
after INSERT
ON SDSADM.STD_PLANCATEGORYTYPEHISTORY
BEGIN
	-- update the table for STD_PlanCategoryTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlanCategoryTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PlanCategoryTypeHstry
after UPDATE
ON SDSADM.STD_PLANCATEGORYTYPEHISTORY
BEGIN
	-- update the table for STD_PlanCategoryTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlanCategoryTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PLANCATEGORYTYPEHISTORY FOR SDSADM.STD_PLANCATEGORYTYPEHISTORY;


ALTER TABLE SDSADM.STD_PLANCATEGORYTYPEHISTORY ADD (
  CONSTRAINT PK_STD_PLANCATEGORYTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PLANCATEGORYTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PLANCATEGORYTYPEHISTORY ADD (
  CONSTRAINT FKSTD_PLANCATEGORYTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PLANCATEGORYTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PLANCATEGORYTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PLANCATEGORYTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PLANCATEGORYTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PLANCATEGORYTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PLANCATEGORYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PLANCATEGORYTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PLANCATEGORYTYPE ON SDSADM.STD_PLANCATEGORYTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PLANCATEGORYTYPECODE ON SDSADM.STD_PLANCATEGORYTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PLANCATEGORYTYPENAME ON SDSADM.STD_PLANCATEGORYTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PlanCategoryType
after DELETE
ON SDSADM.STD_PLANCATEGORYTYPE
BEGIN
	-- update the table for STD_PlanCategoryType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlanCategoryType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PlanCategoryType
after INSERT
ON SDSADM.STD_PLANCATEGORYTYPE
BEGIN
	-- update the table for STD_PlanCategoryType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlanCategoryType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PlanCategoryType
after UPDATE
ON SDSADM.STD_PLANCATEGORYTYPE
BEGIN
	-- update the table for STD_PlanCategoryType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlanCategoryType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PLANCATEGORYTYPE FOR SDSADM.STD_PLANCATEGORYTYPE;


ALTER TABLE SDSADM.STD_PLANCATEGORYTYPE ADD (
  CONSTRAINT PK_STD_PLANCATEGORYTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PLANCATEGORYTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PLANCATEGORYTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PLANCATEGORYTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PLANCATEGORYTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PLANCATEGORYTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PLANCATEGORYTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PLANCATEGORYTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PLANCATEGORYTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PLANCATEGORYTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PLACEOFADMISSIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PLACEOFADMISSIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PLACEOFADMISSIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PLACEOFADMISSIONHISTORY ON SDSADM.STD_PLACEOFADMISSIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PlaceofAdmissionHstry
after DELETE
ON SDSADM.STD_PLACEOFADMISSIONHISTORY
BEGIN
	-- update the table for STD_PlaceofAdmissionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlaceofAdmissionHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PlaceofAdmissionHstry
after INSERT
ON SDSADM.STD_PLACEOFADMISSIONHISTORY
BEGIN
	-- update the table for STD_PlaceofAdmissionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlaceofAdmissionHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PlaceofAdmissionHstry
after UPDATE
ON SDSADM.STD_PLACEOFADMISSIONHISTORY
BEGIN
	-- update the table for STD_PlaceofAdmissionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlaceofAdmissionHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PLACEOFADMISSIONHISTORY FOR SDSADM.STD_PLACEOFADMISSIONHISTORY;


ALTER TABLE SDSADM.STD_PLACEOFADMISSIONHISTORY ADD (
  CONSTRAINT PK_STD_PLACEOFADMISSIONHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PLACEOFADMISSIONHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PLACEOFADMISSIONHISTORY ADD (
  CONSTRAINT FKSTD_PLACEOFADMSSNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PLACEOFADMISSION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PLACEOFADMISSIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PLACEOFADMISSIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PLACEOFADMISSIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PLACEOFADMISSION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PLACEOFADMISSION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PLACEOFADMISSION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(20 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PLACEOFADMISSION ON SDSADM.STD_PLACEOFADMISSION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PLACEOFADMISSIONCODE ON SDSADM.STD_PLACEOFADMISSION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PLACEOFADMISSIONNAME ON SDSADM.STD_PLACEOFADMISSION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PlaceofAdmission
after DELETE
ON SDSADM.STD_PLACEOFADMISSION
BEGIN
	-- update the table for STD_PlaceofAdmission operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlaceofAdmission';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PlaceofAdmission
after INSERT
ON SDSADM.STD_PLACEOFADMISSION
BEGIN
	-- update the table for STD_PlaceofAdmission operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlaceofAdmission';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PlaceofAdmission
after UPDATE
ON SDSADM.STD_PLACEOFADMISSION
BEGIN
	-- update the table for STD_PlaceofAdmission operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PlaceofAdmission';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PLACEOFADMISSION FOR SDSADM.STD_PLACEOFADMISSION;


ALTER TABLE SDSADM.STD_PLACEOFADMISSION ADD (
  CONSTRAINT PK_STD_PLACEOFADMISSION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PLACEOFADMISSION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PLACEOFADMISSIONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PLACEOFADMISSIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PLACEOFADMISSIONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PLACEOFADMISSIONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PLACEOFADMISSION TO ADR;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSION TO ADREXT;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSION TO EESRV;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PLACEOFADMISSION TO LOBR;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PLACEOFADMISSION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PLACEOFADMISSION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PHONECONTACTTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PHONECONTACTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PHONECONTACTTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PHONECONTACTTYPEHISTORY ON SDSADM.STD_PHONECONTACTTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PhoneContactTypeHstry
after DELETE
ON SDSADM.STD_PHONECONTACTTYPEHISTORY
BEGIN
	-- update the table for STD_PhoneContactTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneContactTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PhoneContactTypeHstry
after INSERT
ON SDSADM.STD_PHONECONTACTTYPEHISTORY
BEGIN
	-- update the table for STD_PhoneContactTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneContactTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PhoneContactTypeHstry
after UPDATE
ON SDSADM.STD_PHONECONTACTTYPEHISTORY
BEGIN
	-- update the table for STD_PhoneContactTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneContactTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PHONECONTACTTYPEHISTORY FOR SDSADM.STD_PHONECONTACTTYPEHISTORY;


ALTER TABLE SDSADM.STD_PHONECONTACTTYPEHISTORY ADD (
  CONSTRAINT PK_STD_PHONECONTACTTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PHONECONTACTTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PHONECONTACTTYPEHISTORY ADD (
  CONSTRAINT FKSTD_PHONECONTACTTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PHONECONTACTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PHONECONTACTTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PHONECONTACTTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PHONECONTACTTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PHONECONTACTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PHONECONTACTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PHONECONTACTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PHONECONTACTTYPE ON SDSADM.STD_PHONECONTACTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PHONECONTACTTYPECODE ON SDSADM.STD_PHONECONTACTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PHONECONTACTTYPENAME ON SDSADM.STD_PHONECONTACTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PhoneContactType
after DELETE
ON SDSADM.STD_PHONECONTACTTYPE
BEGIN
	-- update the table for STD_PhoneContactType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneContactType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PhoneContactType
after INSERT
ON SDSADM.STD_PHONECONTACTTYPE
BEGIN
	-- update the table for STD_PhoneContactType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneContactType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PhoneContactType
after UPDATE
ON SDSADM.STD_PHONECONTACTTYPE
BEGIN
	-- update the table for STD_PhoneContactType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneContactType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PHONECONTACTTYPE FOR SDSADM.STD_PHONECONTACTTYPE;


ALTER TABLE SDSADM.STD_PHONECONTACTTYPE ADD (
  CONSTRAINT PK_STD_PHONECONTACTTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PHONECONTACTTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PHONECONTACTTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PHONECONTACTTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PHONECONTACTTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PHONECONTACTTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PHONECONTACTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PHONECONTACTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PHONECONTACTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PHONECONTACTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PHONECHANGESOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PHONECHANGESOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PHONECHANGESOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PHONECHANGESOURCEHSTRY ON SDSADM.STD_PHONECHANGESOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PhoneChangeSrcHstry
after DELETE
ON SDSADM.STD_PHONECHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_PhoneChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PhoneChangeSrcHstry
after INSERT
ON SDSADM.STD_PHONECHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_PhoneChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PhoneChangeSrcHstry
after UPDATE
ON SDSADM.STD_PHONECHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_PhoneChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneChangeSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PHONECHANGESOURCEHISTORY FOR SDSADM.STD_PHONECHANGESOURCEHISTORY;


ALTER TABLE SDSADM.STD_PHONECHANGESOURCEHISTORY ADD (
  CONSTRAINT PK_STD_PHONECHANGESOURCEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PHONECHANGESOURCEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PHONECHANGESOURCEHISTORY ADD (
  CONSTRAINT FKSTD_PHONECHANGESRCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PHONECHANGESOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PHONECHANGESOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PHONECHANGESOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PHONECHANGESOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PHONECHANGESOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PHONECHANGESOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PHONECHANGESOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PHONECHANGESOURCE ON SDSADM.STD_PHONECHANGESOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PHONECHANGESOURCECODE ON SDSADM.STD_PHONECHANGESOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PHONECHANGESOURCENAME ON SDSADM.STD_PHONECHANGESOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PhoneChangeSource
after DELETE
ON SDSADM.STD_PHONECHANGESOURCE
BEGIN
	-- update the table for STD_PhoneChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PhoneChangeSource
after INSERT
ON SDSADM.STD_PHONECHANGESOURCE
BEGIN
	-- update the table for STD_PhoneChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PhoneChangeSource
after UPDATE
ON SDSADM.STD_PHONECHANGESOURCE
BEGIN
	-- update the table for STD_PhoneChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PhoneChangeSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PHONECHANGESOURCE FOR SDSADM.STD_PHONECHANGESOURCE;


ALTER TABLE SDSADM.STD_PHONECHANGESOURCE ADD (
  CONSTRAINT PK_STD_PHONECHANGESOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PHONECHANGESOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PHONECHANGESOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PHONECHANGESOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PHONECHANGESOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PHONECHANGESOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PHONECHANGESOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PHONECHANGESOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PHONECHANGESOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PHONECHANGESOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PHDATASRCTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PHDATASRCTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PHDATASRCTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PHDATASRCTYPEHISTORY ON SDSADM.STD_PHDATASRCTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PHDataSrcTypeHistory
after DELETE
ON SDSADM.STD_PHDATASRCTYPEHISTORY
BEGIN
	-- update the table for STD_PHDataSrcTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PHDataSrcTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PHDataSrcTypeHistory
after INSERT
ON SDSADM.STD_PHDATASRCTYPEHISTORY
BEGIN
	-- update the table for STD_PHDataSrcTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PHDataSrcTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PHDataSrcTypeHistory
after UPDATE
ON SDSADM.STD_PHDATASRCTYPEHISTORY
BEGIN
	-- update the table for STD_PHDataSrcTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PHDataSrcTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PHDATASRCTYPEHISTORY FOR SDSADM.STD_PHDATASRCTYPEHISTORY;


ALTER TABLE SDSADM.STD_PHDATASRCTYPEHISTORY ADD (
  CONSTRAINT PK_STD_PHDATASRCTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PHDATASRCTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PHDATASRCTYPEHISTORY ADD (
  CONSTRAINT FKSTD_PHDATASRCTYPEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PHDATASRCTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PHDATASRCTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PHDATASRCTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PHDATASRCTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PHDATASRCTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PHDATASRCTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PHDATASRCTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(60 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PHDATASRCTYPE ON SDSADM.STD_PHDATASRCTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PHDATASRCTYPECODE ON SDSADM.STD_PHDATASRCTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PHDATASRCTYPENAME ON SDSADM.STD_PHDATASRCTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PHDataSrcType
after DELETE
ON SDSADM.STD_PHDATASRCTYPE
BEGIN
	-- update the table for STD_PHDataSrcType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PHDataSrcType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PHDataSrcType
after INSERT
ON SDSADM.STD_PHDATASRCTYPE
BEGIN
	-- update the table for STD_PHDataSrcType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PHDataSrcType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PHDataSrcType
after UPDATE
ON SDSADM.STD_PHDATASRCTYPE
BEGIN
	-- update the table for STD_PHDataSrcType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PHDataSrcType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PHDATASRCTYPE FOR SDSADM.STD_PHDATASRCTYPE;


ALTER TABLE SDSADM.STD_PHDATASRCTYPE ADD (
  CONSTRAINT PK_STD_PHDATASRCTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PHDATASRCTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PHDATASRCTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PHDATASRCTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PHDATASRCTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PHDATASRCTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PHDATASRCTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PHDATASRCTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PHDATASRCTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PHDATASRCTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONRELATIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONRELATIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONRELATIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONRELATIONHISTORY ON SDSADM.STD_PERSONRELATIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonRelationHistory
after DELETE
ON SDSADM.STD_PERSONRELATIONHISTORY
BEGIN
	-- update the table for STD_PersonRelationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonRelationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonRelationHistory
after INSERT
ON SDSADM.STD_PERSONRELATIONHISTORY
BEGIN
	-- update the table for STD_PersonRelationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonRelationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonRelationHistory
after UPDATE
ON SDSADM.STD_PERSONRELATIONHISTORY
BEGIN
	-- update the table for STD_PersonRelationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonRelationHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONRELATIONHISTORY FOR SDSADM.STD_PERSONRELATIONHISTORY;


ALTER TABLE SDSADM.STD_PERSONRELATIONHISTORY ADD (
  CONSTRAINT PK_STD_PERSONRELATIONHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONRELATIONHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERSONRELATIONHISTORY ADD (
  CONSTRAINT FKSTD_PERSONRELATIONHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PERSONRELATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONRELATIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONRELATIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONRELATIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONRELATIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONRELATIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONRELATIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONRELATIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONRELATIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONRELATIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONRELATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONRELATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONRELATION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONRELATION ON SDSADM.STD_PERSONRELATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONRELATIONCODE ON SDSADM.STD_PERSONRELATION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONRELATIONNAME ON SDSADM.STD_PERSONRELATION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonRelation
after DELETE
ON SDSADM.STD_PERSONRELATION
BEGIN
	-- update the table for STD_PersonRelation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonRelation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonRelation
after INSERT
ON SDSADM.STD_PERSONRELATION
BEGIN
	-- update the table for STD_PersonRelation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonRelation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonRelation
after UPDATE
ON SDSADM.STD_PERSONRELATION
BEGIN
	-- update the table for STD_PersonRelation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonRelation';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONRELATION FOR SDSADM.STD_PERSONRELATION;


ALTER TABLE SDSADM.STD_PERSONRELATION ADD (
  CONSTRAINT PK_STD_PERSONRELATION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONRELATION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONRELATIONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PERSONRELATIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONRELATIONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PERSONRELATIONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONRELATION TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONRELATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONRELATION TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONRELATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONRELATION TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONRELATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONRELATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONRELATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONRELATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONMERGESTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONMERGESTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONMERGESTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONMERGESTATUSHSTRY ON SDSADM.STD_PERSONMERGESTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonMergeSttsHstry
after DELETE
ON SDSADM.STD_PERSONMERGESTATUSHISTORY
BEGIN
	-- update the table for STD_PersonMergeStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonMergeStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonMergeSttsHstry
after INSERT
ON SDSADM.STD_PERSONMERGESTATUSHISTORY
BEGIN
	-- update the table for STD_PersonMergeStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonMergeStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonMergeSttsHstry
after UPDATE
ON SDSADM.STD_PERSONMERGESTATUSHISTORY
BEGIN
	-- update the table for STD_PersonMergeStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonMergeStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONMERGESTATUSHISTORY FOR SDSADM.STD_PERSONMERGESTATUSHISTORY;


ALTER TABLE SDSADM.STD_PERSONMERGESTATUSHISTORY ADD (
  CONSTRAINT PK_STD_PERSONMERGESTATUSHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONMERGESTATUSHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERSONMERGESTATUSHISTORY ADD (
  CONSTRAINT FKSTD_PERSONMERGESTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PERSONMERGESTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONMERGESTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONMERGESTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONMERGESTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONMERGESTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONMERGESTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONMERGESTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONMERGESTATUS ON SDSADM.STD_PERSONMERGESTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONMERGESTATUSCODE ON SDSADM.STD_PERSONMERGESTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONMERGESTATUSNAME ON SDSADM.STD_PERSONMERGESTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonMergeStatus
after DELETE
ON SDSADM.STD_PERSONMERGESTATUS
BEGIN
	-- update the table for STD_PersonMergeStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonMergeStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonMergeStatus
after INSERT
ON SDSADM.STD_PERSONMERGESTATUS
BEGIN
	-- update the table for STD_PersonMergeStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonMergeStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonMergeStatus
after UPDATE
ON SDSADM.STD_PERSONMERGESTATUS
BEGIN
	-- update the table for STD_PersonMergeStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonMergeStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONMERGESTATUS FOR SDSADM.STD_PERSONMERGESTATUS;


ALTER TABLE SDSADM.STD_PERSONMERGESTATUS ADD (
  CONSTRAINT PK_STD_PERSONMERGESTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONMERGESTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONMERGESTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PERSONMERGESTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONMERGESTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PERSONMERGESTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONMERGESTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONMERGESTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONMERGESTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONMERGESTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCONTACTTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCONTACTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCONTACTTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCONTACTTYPEHSTRY ON SDSADM.STD_PERSONCONTACTTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonContactTypHstry
after DELETE
ON SDSADM.STD_PERSONCONTACTTYPEHISTORY
BEGIN
	-- update the table for STD_PersonContactTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonContactTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonContactTypHstry
after INSERT
ON SDSADM.STD_PERSONCONTACTTYPEHISTORY
BEGIN
	-- update the table for STD_PersonContactTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonContactTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonContactTypHstry
after UPDATE
ON SDSADM.STD_PERSONCONTACTTYPEHISTORY
BEGIN
	-- update the table for STD_PersonContactTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonContactTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCONTACTTYPEHISTORY FOR SDSADM.STD_PERSONCONTACTTYPEHISTORY;


ALTER TABLE SDSADM.STD_PERSONCONTACTTYPEHISTORY ADD (
  CONSTRAINT PK_STD_PERSONCONTACTTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCONTACTTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERSONCONTACTTYPEHISTORY ADD (
  CONSTRAINT FKSTD_PERSONCNTCTTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PERSONCONTACTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCONTACTTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCONTACTTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCONTACTTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCONTACTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCONTACTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCONTACTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCONTACTTYPE ON SDSADM.STD_PERSONCONTACTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCONTACTTYPECODE ON SDSADM.STD_PERSONCONTACTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCONTACTTYPENAME ON SDSADM.STD_PERSONCONTACTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonContactType
after DELETE
ON SDSADM.STD_PERSONCONTACTTYPE
BEGIN
	-- update the table for STD_PersonContactType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonContactType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonContactType
after INSERT
ON SDSADM.STD_PERSONCONTACTTYPE
BEGIN
	-- update the table for STD_PersonContactType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonContactType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonContactType
after UPDATE
ON SDSADM.STD_PERSONCONTACTTYPE
BEGIN
	-- update the table for STD_PersonContactType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonContactType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCONTACTTYPE FOR SDSADM.STD_PERSONCONTACTTYPE;


ALTER TABLE SDSADM.STD_PERSONCONTACTTYPE ADD (
  CONSTRAINT PK_STD_PERSONCONTACTTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCONTACTTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCONTACTTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PERSONCONTACTTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCONTACTTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PERSONCONTACTTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCONTACTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCONTACTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCONTACTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCONTACTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCLASSPTHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCLASSPTHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCLASSPTHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCLASSPTHISTORY ON SDSADM.STD_PERSONCLASSPTHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonClassPTHistory
after DELETE
ON SDSADM.STD_PERSONCLASSPTHISTORY
BEGIN
	-- update the table for STD_PersonClassPTHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassPTHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonClassPTHistory
after INSERT
ON SDSADM.STD_PERSONCLASSPTHISTORY
BEGIN
	-- update the table for STD_PersonClassPTHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassPTHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonClassPTHistory
after UPDATE
ON SDSADM.STD_PERSONCLASSPTHISTORY
BEGIN
	-- update the table for STD_PersonClassPTHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassPTHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCLASSPTHISTORY FOR SDSADM.STD_PERSONCLASSPTHISTORY;


ALTER TABLE SDSADM.STD_PERSONCLASSPTHISTORY ADD (
  CONSTRAINT PK_STD_PERSONCLASSPTHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCLASSPTHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERSONCLASSPTHISTORY ADD (
  CONSTRAINT FKSTD_PERSONCLASSPTHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PERSONCLASSPROVIDERTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSPTHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPTHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPTHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPTHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSPTHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPTHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCLASSPTHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPTHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPTHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCLASSPROVIDERTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCLASSPROVIDERTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCLASSPROVIDERTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCLASSPT ON SDSADM.STD_PERSONCLASSPROVIDERTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCLASSPTNAME ON SDSADM.STD_PERSONCLASSPROVIDERTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonClassPT
after DELETE
ON SDSADM.STD_PERSONCLASSPROVIDERTYPE
BEGIN
	-- update the table for STD_PersonClassProviderType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassProviderType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonClassPT
after INSERT
ON SDSADM.STD_PERSONCLASSPROVIDERTYPE
BEGIN
	-- update the table for STD_PersonClassProviderType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassProviderType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonClassPT
after UPDATE
ON SDSADM.STD_PERSONCLASSPROVIDERTYPE
BEGIN
	-- update the table for STD_PersonClassProviderType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassProviderType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCLASSPROVIDERTYPE FOR SDSADM.STD_PERSONCLASSPROVIDERTYPE;


ALTER TABLE SDSADM.STD_PERSONCLASSPROVIDERTYPE ADD (
  CONSTRAINT PK_STD_PERSONCLASSPT
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCLASSPT
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCLASSPTNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PERSONCLASSPTNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSPROVIDERTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPROVIDERTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPROVIDERTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPROVIDERTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSPROVIDERTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPROVIDERTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCLASSPROVIDERTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPROVIDERTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCLASSPROVIDERTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCLASSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCLASSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCLASSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCLASSHISTORY ON SDSADM.STD_PERSONCLASSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonClassHistory
after DELETE
ON SDSADM.STD_PERSONCLASSHISTORY
BEGIN
	-- update the table for STD_PersonClassHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonClassHistory
after INSERT
ON SDSADM.STD_PERSONCLASSHISTORY
BEGIN
	-- update the table for STD_PersonClassHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonClassHistory
after UPDATE
ON SDSADM.STD_PERSONCLASSHISTORY
BEGIN
	-- update the table for STD_PersonClassHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCLASSHISTORY FOR SDSADM.STD_PERSONCLASSHISTORY;


ALTER TABLE SDSADM.STD_PERSONCLASSHISTORY ADD (
  CONSTRAINT PK_STD_PERSONCLASSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCLASSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERSONCLASSHISTORY ADD (
  CONSTRAINT FKSTD_PERSONCLASSHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PERSONCLASS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCLASSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCLASSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCLASSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCLASSCLASSIFICATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCLASSCLASSIFICATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCLASSCLASSIFICATION
(
  ID           NUMBER(20)                       NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCLASSC ON SDSADM.STD_PERSONCLASSCLASSIFICATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCLASSCNAME ON SDSADM.STD_PERSONCLASSCLASSIFICATION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonClassC
after DELETE
ON SDSADM.STD_PERSONCLASSCLASSIFICATION
BEGIN
	-- update the table for STD_PersonClassClassification operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassClassification';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonClassC
after INSERT
ON SDSADM.STD_PERSONCLASSCLASSIFICATION
BEGIN
	-- update the table for STD_PersonClassClassification operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassClassification';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonClassC
after UPDATE
ON SDSADM.STD_PERSONCLASSCLASSIFICATION
BEGIN
	-- update the table for STD_PersonClassClassification operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassClassification';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCLASSCLASSIFICATION FOR SDSADM.STD_PERSONCLASSCLASSIFICATION;


ALTER TABLE SDSADM.STD_PERSONCLASSCLASSIFICATION ADD (
  CONSTRAINT PK_STD_PERSONCLASSC
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCLASSC
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCLASSCNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PERSONCLASSCNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSCLASSIFICATION TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCLASSIFICATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCLASSIFICATION TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCLASSIFICATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSCLASSIFICATION TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCLASSIFICATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCLASSCLASSIFICATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCLASSIFICATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCLASSIFICATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCLASSCHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCLASSCHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCLASSCHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCLASSCHISTORY ON SDSADM.STD_PERSONCLASSCHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonClassCHistory
after DELETE
ON SDSADM.STD_PERSONCLASSCHISTORY
BEGIN
	-- update the table for STD_PersonClassCHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassCHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonClassCHistory
after INSERT
ON SDSADM.STD_PERSONCLASSCHISTORY
BEGIN
	-- update the table for STD_PersonClassCHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassCHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonClassCHistory
after UPDATE
ON SDSADM.STD_PERSONCLASSCHISTORY
BEGIN
	-- update the table for STD_PersonClassCHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClassCHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCLASSCHISTORY FOR SDSADM.STD_PERSONCLASSCHISTORY;


ALTER TABLE SDSADM.STD_PERSONCLASSCHISTORY ADD (
  CONSTRAINT PK_STD_PERSONCLASSCHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCLASSCHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERSONCLASSCHISTORY ADD (
  CONSTRAINT FKSTD_PERSONCLASSCHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PERSONCLASSCLASSIFICATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSCHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCLASSCHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCLASSCHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCLASSCHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCLASS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCLASS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCLASS
(
  ID                    NUMBER(20)              NOT NULL,
  IEN                   NUMBER(10)              NOT NULL,
  VACODE                VARCHAR2(7 BYTE)        NOT NULL,
  AREAOFSPECIALIZATION  VARCHAR2(100 BYTE),
  ISTRAINEEPERSONCLASS  CHAR(1 BYTE),
  CLASSIFICATION_ID     NUMBER(20),
  PROVIDERTYPE_ID       NUMBER(20)              NOT NULL,
  X12CODE               VARCHAR2(10 BYTE),
  NUCCCODE              VARCHAR2(10 BYTE),
  DESCRIPTION           VARCHAR2(2000 BYTE),
  SOURCE                VARCHAR2(1000 BYTE),
  VERSION               INTEGER                 NOT NULL,
  CREATED               TIMESTAMP(6)            NOT NULL,
  UPDATED               TIMESTAMP(6),
  CREATEDBY             VARCHAR2(32 BYTE)       NOT NULL,
  UPDATEDBY             VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCLASS ON SDSADM.STD_PERSONCLASS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCLASSIEN ON SDSADM.STD_PERSONCLASS
(IEN)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCLASSNUCCCODE ON SDSADM.STD_PERSONCLASS
(NUCCCODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCLASSVACODE ON SDSADM.STD_PERSONCLASS
(VACODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCLASSX12CODE ON SDSADM.STD_PERSONCLASS
(X12CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonClass
after DELETE
ON SDSADM.STD_PERSONCLASS
BEGIN
	-- update the table for STD_PersonClass operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClass';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonClass
after INSERT
ON SDSADM.STD_PERSONCLASS
BEGIN
	-- update the table for STD_PersonClass operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClass';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonClass
after UPDATE
ON SDSADM.STD_PERSONCLASS
BEGIN
	-- update the table for STD_PersonClass operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonClass';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCLASS FOR SDSADM.STD_PERSONCLASS;


ALTER TABLE SDSADM.STD_PERSONCLASS ADD (
  CONSTRAINT PK_STD_PERSONCLASS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCLASS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCLASSIEN
  UNIQUE (IEN)
  USING INDEX SDSADM.UQSTD_PERSONCLASSIEN
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCLASSNUCCCODE
  UNIQUE (NUCCCODE)
  USING INDEX SDSADM.UQSTD_PERSONCLASSNUCCCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCLASSVACODE
  UNIQUE (VACODE)
  USING INDEX SDSADM.UQSTD_PERSONCLASSVACODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCLASSX12CODE
  UNIQUE (X12CODE)
  USING INDEX SDSADM.UQSTD_PERSONCLASSX12CODE
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERSONCLASS ADD (
  CONSTRAINT FKSTD_PERSONCLASSCLSSFCTN 
  FOREIGN KEY (CLASSIFICATION_ID) 
  REFERENCES SDSADM.STD_PERSONCLASSCLASSIFICATION (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_PERSONCLASSPROVIDERTYPE 
  FOREIGN KEY (PROVIDERTYPE_ID) 
  REFERENCES SDSADM.STD_PERSONCLASSPROVIDERTYPE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCLASS TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCLASS TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCLASS TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCLASS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCLASS TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCLASS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCLASS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCLASS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCLASS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCATEGORYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCATEGORYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCATEGORYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCATEGORYHISTORY ON SDSADM.STD_PERSONCATEGORYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonCategoryHistory
after DELETE
ON SDSADM.STD_PERSONCATEGORYHISTORY
BEGIN
	-- update the table for STD_PersonCategoryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonCategoryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonCategoryHistory
after INSERT
ON SDSADM.STD_PERSONCATEGORYHISTORY
BEGIN
	-- update the table for STD_PersonCategoryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonCategoryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonCategoryHistory
after UPDATE
ON SDSADM.STD_PERSONCATEGORYHISTORY
BEGIN
	-- update the table for STD_PersonCategoryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonCategoryHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCATEGORYHISTORY FOR SDSADM.STD_PERSONCATEGORYHISTORY;


ALTER TABLE SDSADM.STD_PERSONCATEGORYHISTORY ADD (
  CONSTRAINT PK_STD_PERSONCATEGORYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCATEGORYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERSONCATEGORYHISTORY ADD (
  CONSTRAINT FKSTD_PERSONCATEGORYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PERSONCATEGORY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCATEGORYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCATEGORYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCATEGORYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERSONCATEGORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERSONCATEGORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERSONCATEGORY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERSONCATEGORY ON SDSADM.STD_PERSONCATEGORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCATEGORYCODE ON SDSADM.STD_PERSONCATEGORY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERSONCATEGORYNAME ON SDSADM.STD_PERSONCATEGORY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PersonCategory
after DELETE
ON SDSADM.STD_PERSONCATEGORY
BEGIN
	-- update the table for STD_PersonCategory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonCategory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PersonCategory
after INSERT
ON SDSADM.STD_PERSONCATEGORY
BEGIN
	-- update the table for STD_PersonCategory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonCategory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PersonCategory
after UPDATE
ON SDSADM.STD_PERSONCATEGORY
BEGIN
	-- update the table for STD_PersonCategory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PersonCategory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERSONCATEGORY FOR SDSADM.STD_PERSONCATEGORY;


ALTER TABLE SDSADM.STD_PERSONCATEGORY ADD (
  CONSTRAINT PK_STD_PERSONCATEGORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERSONCATEGORY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCATEGORYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PERSONCATEGORYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERSONCATEGORYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PERSONCATEGORYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERSONCATEGORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERSONCATEGORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERSONCATEGORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERSONCATEGORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERMANENTCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERMANENTCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERMANENTCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERMANENTCODEHISTORY ON SDSADM.STD_PERMANENTCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PermanentCodeHistory
after DELETE
ON SDSADM.STD_PERMANENTCODEHISTORY
BEGIN
	-- update the table for STD_PermanentCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PermanentCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PermanentCodeHistory
after INSERT
ON SDSADM.STD_PERMANENTCODEHISTORY
BEGIN
	-- update the table for STD_PermanentCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PermanentCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PermanentCodeHistory
after UPDATE
ON SDSADM.STD_PERMANENTCODEHISTORY
BEGIN
	-- update the table for STD_PermanentCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PermanentCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERMANENTCODEHISTORY FOR SDSADM.STD_PERMANENTCODEHISTORY;


ALTER TABLE SDSADM.STD_PERMANENTCODEHISTORY ADD (
  CONSTRAINT PK_STD_PERMANENTCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERMANENTCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERMANENTCODEHISTORY ADD (
  CONSTRAINT FKSTD_PERMANENTCODEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PERMANENTCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERMANENTCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERMANENTCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERMANENTCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERMANENTCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERMANENTCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERMANENTCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERMANENTCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERMANENTCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERMANENTCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERMANENTCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERMANENTCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERMANENTCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERMANENTCODE ON SDSADM.STD_PERMANENTCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERMANENTCODECODE ON SDSADM.STD_PERMANENTCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERMANENTCODENAME ON SDSADM.STD_PERMANENTCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PermanentCode
after DELETE
ON SDSADM.STD_PERMANENTCODE
BEGIN
	-- update the table for STD_PermanentCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PermanentCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PermanentCode
after INSERT
ON SDSADM.STD_PERMANENTCODE
BEGIN
	-- update the table for STD_PermanentCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PermanentCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PermanentCode
after UPDATE
ON SDSADM.STD_PERMANENTCODE
BEGIN
	-- update the table for STD_PermanentCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PermanentCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERMANENTCODE FOR SDSADM.STD_PERMANENTCODE;


ALTER TABLE SDSADM.STD_PERMANENTCODE ADD (
  CONSTRAINT PK_STD_PERMANENTCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERMANENTCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERMANENTCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PERMANENTCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERMANENTCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PERMANENTCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERMANENTCODE TO ADR;

GRANT SELECT ON SDSADM.STD_PERMANENTCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERMANENTCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_PERMANENTCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERMANENTCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_PERMANENTCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERMANENTCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERMANENTCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERMANENTCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERIODOFSERVICEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERIODOFSERVICEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERIODOFSERVICEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERIODOFSERVICEHISTORY ON SDSADM.STD_PERIODOFSERVICEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PeriodOfServiceHstry
after DELETE
ON SDSADM.STD_PERIODOFSERVICEHISTORY
BEGIN
	-- update the table for STD_PeriodOfServiceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PeriodOfServiceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PeriodOfServiceHstry
after INSERT
ON SDSADM.STD_PERIODOFSERVICEHISTORY
BEGIN
	-- update the table for STD_PeriodOfServiceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PeriodOfServiceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PeriodOfServiceHstry
after UPDATE
ON SDSADM.STD_PERIODOFSERVICEHISTORY
BEGIN
	-- update the table for STD_PeriodOfServiceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PeriodOfServiceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERIODOFSERVICEHISTORY FOR SDSADM.STD_PERIODOFSERVICEHISTORY;


ALTER TABLE SDSADM.STD_PERIODOFSERVICEHISTORY ADD (
  CONSTRAINT PK_STD_PERIODOFSERVICEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERIODOFSERVICEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PERIODOFSERVICEHISTORY ADD (
  CONSTRAINT FKSTD_PERIODOFSERVICEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PERIODOFSERVICE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERIODOFSERVICEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERIODOFSERVICEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERIODOFSERVICEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PERIODOFSERVICE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PERIODOFSERVICE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PERIODOFSERVICE
(
  ID                 NUMBER(20)                 NOT NULL,
  CODE               CHAR(1 BYTE)               NOT NULL,
  NAME               VARCHAR2(25 BYTE)          NOT NULL,
  DESCRIPTION        VARCHAR2(26 BYTE),
  ALTERNATENAME      VARCHAR2(9 BYTE),
  BEGINDATE          DATE,
  ENDDATE            DATE,
  WARPEACE           CHAR(1 BYTE),
  LATESTDATEOFBIRTH  CHAR(4 BYTE),
  PTFCODE            CHAR(1 BYTE),
  VERSION            INTEGER                    NOT NULL,
  CREATED            TIMESTAMP(6)               NOT NULL,
  UPDATED            TIMESTAMP(6),
  CREATEDBY          VARCHAR2(32 BYTE)          NOT NULL,
  UPDATEDBY          VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PERIODOFSERVICE ON SDSADM.STD_PERIODOFSERVICE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERIODOFSERVICECODE ON SDSADM.STD_PERIODOFSERVICE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PERIODOFSERVICENAME ON SDSADM.STD_PERIODOFSERVICE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PeriodOfService
after DELETE
ON SDSADM.STD_PERIODOFSERVICE
BEGIN
	-- update the table for STD_PeriodOfService operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PeriodOfService';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PeriodOfService
after INSERT
ON SDSADM.STD_PERIODOFSERVICE
BEGIN
	-- update the table for STD_PeriodOfService operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PeriodOfService';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PeriodOfService
after UPDATE
ON SDSADM.STD_PERIODOFSERVICE
BEGIN
	-- update the table for STD_PeriodOfService operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PeriodOfService';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PERIODOFSERVICE FOR SDSADM.STD_PERIODOFSERVICE;


ALTER TABLE SDSADM.STD_PERIODOFSERVICE ADD (
  CONSTRAINT PK_STD_PERIODOFSERVICE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PERIODOFSERVICE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERIODOFSERVICECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PERIODOFSERVICECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PERIODOFSERVICENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PERIODOFSERVICENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PERIODOFSERVICE TO ADR;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICE TO EESRV;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PERIODOFSERVICE TO LOBR;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PERIODOFSERVICE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PERIODOFSERVICE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PATIENTTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PATIENTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PATIENTTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PATIENTTYPEHISTORY ON SDSADM.STD_PATIENTTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PatientTypeHistory
after DELETE
ON SDSADM.STD_PATIENTTYPEHISTORY
BEGIN
	-- update the table for STD_PatientTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PatientTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PatientTypeHistory
after INSERT
ON SDSADM.STD_PATIENTTYPEHISTORY
BEGIN
	-- update the table for STD_PatientTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PatientTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PatientTypeHistory
after UPDATE
ON SDSADM.STD_PATIENTTYPEHISTORY
BEGIN
	-- update the table for STD_PatientTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PatientTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PATIENTTYPEHISTORY FOR SDSADM.STD_PATIENTTYPEHISTORY;


ALTER TABLE SDSADM.STD_PATIENTTYPEHISTORY ADD (
  CONSTRAINT PK_STD_PATIENTTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PATIENTTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_PATIENTTYPEHISTORY ADD (
  CONSTRAINT FKSTD_PATIENTTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_PATIENTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PATIENTTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_PATIENTTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_PATIENTTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_PATIENTTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PATIENTTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_PATIENTTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PATIENTTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PATIENTTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PATIENTTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_PATIENTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_PATIENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_PATIENTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_PATIENTTYPE ON SDSADM.STD_PATIENTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PATIENTTYPECODE ON SDSADM.STD_PATIENTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_PATIENTTYPENAME ON SDSADM.STD_PATIENTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_PatientType
after DELETE
ON SDSADM.STD_PATIENTTYPE
BEGIN
	-- update the table for STD_PatientType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PatientType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_PatientType
after INSERT
ON SDSADM.STD_PATIENTTYPE
BEGIN
	-- update the table for STD_PatientType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PatientType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_PatientType
after UPDATE
ON SDSADM.STD_PATIENTTYPE
BEGIN
	-- update the table for STD_PatientType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_PatientType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_PATIENTTYPE FOR SDSADM.STD_PATIENTTYPE;


ALTER TABLE SDSADM.STD_PATIENTTYPE ADD (
  CONSTRAINT PK_STD_PATIENTTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_PATIENTTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PATIENTTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_PATIENTTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_PATIENTTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_PATIENTTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_PATIENTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_PATIENTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_PATIENTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_PATIENTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_PATIENTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_PATIENTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_PATIENTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_PATIENTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_PATIENTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_OTHERFEDERALAGENCYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_OTHERFEDERALAGENCYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_OTHERFEDERALAGENCYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_OTHERFEDERALAGENCYHSTRY ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_OtherFdrlAgncyHstry
after DELETE
ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY
BEGIN
	-- update the table for STD_OtherFederalAgencyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OtherFederalAgencyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_OtherFdrlAgncyHstry
after INSERT
ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY
BEGIN
	-- update the table for STD_OtherFederalAgencyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OtherFederalAgencyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_OtherFdrlAgncyHstry
after UPDATE
ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY
BEGIN
	-- update the table for STD_OtherFederalAgencyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OtherFederalAgencyHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_OTHERFEDERALAGENCYHISTORY FOR SDSADM.STD_OTHERFEDERALAGENCYHISTORY;


ALTER TABLE SDSADM.STD_OTHERFEDERALAGENCYHISTORY ADD (
  CONSTRAINT PK_STD_OTHERFEDERALAGENCYHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_OTHERFEDERALAGENCYHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_OTHERFEDERALAGENCYHISTORY ADD (
  CONSTRAINT FKSTD_OTHERFDRLAGNCYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_OTHERFEDERALAGENCY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_OTHERFEDERALAGENCY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_OTHERFEDERALAGENCY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_OTHERFEDERALAGENCY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_OTHERFEDERALAGENCY ON SDSADM.STD_OTHERFEDERALAGENCY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_OTHERFEDERALAGENCYCODE ON SDSADM.STD_OTHERFEDERALAGENCY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_OTHERFEDERALAGENCYNAME ON SDSADM.STD_OTHERFEDERALAGENCY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_OtherFederalAgency
after DELETE
ON SDSADM.STD_OTHERFEDERALAGENCY
BEGIN
	-- update the table for STD_OtherFederalAgency operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OtherFederalAgency';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_OtherFederalAgency
after INSERT
ON SDSADM.STD_OTHERFEDERALAGENCY
BEGIN
	-- update the table for STD_OtherFederalAgency operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OtherFederalAgency';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_OtherFederalAgency
after UPDATE
ON SDSADM.STD_OTHERFEDERALAGENCY
BEGIN
	-- update the table for STD_OtherFederalAgency operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OtherFederalAgency';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_OTHERFEDERALAGENCY FOR SDSADM.STD_OTHERFEDERALAGENCY;


ALTER TABLE SDSADM.STD_OTHERFEDERALAGENCY ADD (
  CONSTRAINT PK_STD_OTHERFEDERALAGENCY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_OTHERFEDERALAGENCY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_OTHERFEDERALAGENCYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_OTHERFEDERALAGENCYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_OTHERFEDERALAGENCYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_OTHERFEDERALAGENCYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_OTHERFEDERALAGENCY TO ADR;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCY TO ADREXT;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCY TO EESRV;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_OTHERFEDERALAGENCY TO LOBR;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_OTHERFEDERALAGENCY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_OTHERFEDERALAGENCY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ORGPROVTAXONOMYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ORGPROVTAXONOMYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ORGPROVTAXONOMYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ORGPROVTAXONOMYHISTORY ON SDSADM.STD_ORGPROVTAXONOMYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ORGPROVTAXONOMYHstry
after DELETE
ON SDSADM.STD_ORGPROVTAXONOMYHISTORY
BEGIN
	-- update the table for STD_ORGPROVTAXONOMYHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ORGPROVTAXONOMYHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ORGPROVTAXONOMYHstry
after INSERT
ON SDSADM.STD_ORGPROVTAXONOMYHISTORY
BEGIN
	-- update the table for STD_ORGPROVTAXONOMYHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ORGPROVTAXONOMYHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ORGPROVTAXONOMYHstry
after UPDATE
ON SDSADM.STD_ORGPROVTAXONOMYHISTORY
BEGIN
	-- update the table for STD_ORGPROVTAXONOMYHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ORGPROVTAXONOMYHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ORGPROVTAXONOMYHISTORY FOR SDSADM.STD_ORGPROVTAXONOMYHISTORY;


ALTER TABLE SDSADM.STD_ORGPROVTAXONOMYHISTORY ADD (
  CONSTRAINT PK_STD_ORGPROVTAXONOMYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ORGPROVTAXONOMYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ORGPROVTAXONOMYHISTORY ADD (
  CONSTRAINT FKSTD_ORGPROVTAXONOMYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ORGPROVTAXONOMY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ORGPROVTAXONOMYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ORGPROVTAXONOMYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ORGPROVTAXONOMYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ORGPROVTAXONOMY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ORGPROVTAXONOMY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ORGPROVTAXONOMY
(
  ID                    NUMBER(20)              NOT NULL,
  NUCCCODE              VARCHAR2(15 BYTE)       NOT NULL,
  PROVIDERTYPE          VARCHAR2(200 BYTE)      NOT NULL,
  CLASSIFICATION        VARCHAR2(200 BYTE),
  AREAOFSPECIALIZATION  VARCHAR2(100 BYTE),
  DESCRIPTION           VARCHAR2(2000 BYTE),
  VERSION               INTEGER                 NOT NULL,
  CREATED               TIMESTAMP(6)            NOT NULL,
  UPDATED               TIMESTAMP(6),
  CREATEDBY             VARCHAR2(32 BYTE)       NOT NULL,
  UPDATEDBY             VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ORGPROVTAXONOMY ON SDSADM.STD_ORGPROVTAXONOMY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ORGPROVTAXONOMYNUCCCODE ON SDSADM.STD_ORGPROVTAXONOMY
(NUCCCODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ORGPROVTAXONOMY
after DELETE
ON SDSADM.STD_ORGPROVTAXONOMY
BEGIN
	-- update the table for STD_ORGPROVTAXONOMY operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ORGPROVTAXONOMY';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ORGPROVTAXONOMY
after INSERT
ON SDSADM.STD_ORGPROVTAXONOMY
BEGIN
	-- update the table for STD_ORGPROVTAXONOMY operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ORGPROVTAXONOMY';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ORGPROVTAXONOMY
after UPDATE
ON SDSADM.STD_ORGPROVTAXONOMY
BEGIN
	-- update the table for STD_ORGPROVTAXONOMY operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ORGPROVTAXONOMY';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ORGPROVTAXONOMY FOR SDSADM.STD_ORGPROVTAXONOMY;


ALTER TABLE SDSADM.STD_ORGPROVTAXONOMY ADD (
  CONSTRAINT PK_STD_ORGPROVTAXONOMY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ORGPROVTAXONOMY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ORGPROVTAXONOMYNUCCCODE
  UNIQUE (NUCCCODE)
  USING INDEX SDSADM.UQSTD_ORGPROVTAXONOMYNUCCCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ORGPROVTAXONOMY TO ADR;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMY TO EESRV;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ORGPROVTAXONOMY TO LOBR;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ORGPROVTAXONOMY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ORGPROVTAXONOMY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_OEFOIFSOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_OEFOIFSOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_OEFOIFSOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_OEFOIFSOURCEHISTORY ON SDSADM.STD_OEFOIFSOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_OefOifSourceHistory
after DELETE
ON SDSADM.STD_OEFOIFSOURCEHISTORY
BEGIN
	-- update the table for STD_OefOifSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OefOifSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_OefOifSourceHistory
after INSERT
ON SDSADM.STD_OEFOIFSOURCEHISTORY
BEGIN
	-- update the table for STD_OefOifSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OefOifSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_OefOifSourceHistory
after UPDATE
ON SDSADM.STD_OEFOIFSOURCEHISTORY
BEGIN
	-- update the table for STD_OefOifSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OefOifSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_OEFOIFSOURCEHISTORY FOR SDSADM.STD_OEFOIFSOURCEHISTORY;


ALTER TABLE SDSADM.STD_OEFOIFSOURCEHISTORY ADD (
  CONSTRAINT PK_STD_OEFOIFSOURCEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_OEFOIFSOURCEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_OEFOIFSOURCEHISTORY ADD (
  CONSTRAINT FKSTD_OEFOIFSOURCEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_OEFOIFSOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_OEFOIFSOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_OEFOIFSOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_OEFOIFSOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_OEFOIFSOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_OEFOIFSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_OEFOIFSOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_OEFOIFSOURCE ON SDSADM.STD_OEFOIFSOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_OEFOIFSOURCECODE ON SDSADM.STD_OEFOIFSOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_OEFOIFSOURCENAME ON SDSADM.STD_OEFOIFSOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_OefOifSource
after DELETE
ON SDSADM.STD_OEFOIFSOURCE
BEGIN
	-- update the table for STD_OefOifSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OefOifSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_OefOifSource
after INSERT
ON SDSADM.STD_OEFOIFSOURCE
BEGIN
	-- update the table for STD_OefOifSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OefOifSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_OefOifSource
after UPDATE
ON SDSADM.STD_OEFOIFSOURCE
BEGIN
	-- update the table for STD_OefOifSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_OefOifSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_OEFOIFSOURCE FOR SDSADM.STD_OEFOIFSOURCE;


ALTER TABLE SDSADM.STD_OEFOIFSOURCE ADD (
  CONSTRAINT PK_STD_OEFOIFSOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_OEFOIFSOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_OEFOIFSOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_OEFOIFSOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_OEFOIFSOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_OEFOIFSOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_OEFOIFSOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_OEFOIFSOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_OEFOIFSOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_OEFOIFSOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NTRVERIFICATNMTHDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NTRVERIFICATNMTHDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NTRVERIFICATNMTHDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NTRVERIFICATNMTHDHSTRY ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NTRVrfctnMthdHstry
after DELETE
ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY
BEGIN
	-- update the table for STD_NTRVerificatnMthdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRVerificatnMthdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NTRVrfctnMthdHstry
after INSERT
ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY
BEGIN
	-- update the table for STD_NTRVerificatnMthdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRVerificatnMthdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NTRVrfctnMthdHstry
after UPDATE
ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY
BEGIN
	-- update the table for STD_NTRVerificatnMthdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRVerificatnMthdHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NTRVERIFICATNMTHDHISTORY FOR SDSADM.STD_NTRVERIFICATNMTHDHISTORY;


ALTER TABLE SDSADM.STD_NTRVERIFICATNMTHDHISTORY ADD (
  CONSTRAINT PK_STD_NTRVERIFICATNMTHDHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NTRVERIFICATNMTHDHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_NTRVERIFICATNMTHDHISTORY ADD (
  CONSTRAINT FKSTD_NTRVRFCTNMTHDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_NTRVERIFICATIONMETHOD (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATNMTHDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NTRVERIFICATIONMETHOD
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NTRVERIFICATIONMETHOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NTRVERIFICATIONMETHOD
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(1 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NTRVERIFICATNMTHD ON SDSADM.STD_NTRVERIFICATIONMETHOD
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NTRVERIFICATNMTHDCODE ON SDSADM.STD_NTRVERIFICATIONMETHOD
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NTRVERIFICATNMTHDNAME ON SDSADM.STD_NTRVERIFICATIONMETHOD
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NTRVerificatnMthd
after DELETE
ON SDSADM.STD_NTRVERIFICATIONMETHOD
BEGIN
	-- update the table for STD_NTRVerificationMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRVerificationMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NTRVerificatnMthd
after INSERT
ON SDSADM.STD_NTRVERIFICATIONMETHOD
BEGIN
	-- update the table for STD_NTRVerificationMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRVerificationMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NTRVerificatnMthd
after UPDATE
ON SDSADM.STD_NTRVERIFICATIONMETHOD
BEGIN
	-- update the table for STD_NTRVerificationMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRVerificationMethod';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NTRVERIFICATIONMETHOD FOR SDSADM.STD_NTRVERIFICATIONMETHOD;


ALTER TABLE SDSADM.STD_NTRVERIFICATIONMETHOD ADD (
  CONSTRAINT PK_STD_NTRVERIFICATNMTHD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NTRVERIFICATNMTHD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NTRVERIFICATNMTHDCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_NTRVERIFICATNMTHDCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NTRVERIFICATNMTHDNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_NTRVERIFICATNMTHDNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NTRVERIFICATIONMETHOD TO ADR;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATIONMETHOD TO ADREXT;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATIONMETHOD TO EESRV;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATIONMETHOD TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NTRVERIFICATIONMETHOD TO LOBR;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATIONMETHOD TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NTRVERIFICATIONMETHOD TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATIONMETHOD TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NTRVERIFICATIONMETHOD TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NTRQUALIFIERHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NTRQUALIFIERHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NTRQUALIFIERHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NTRQUALIFIERHISTORY ON SDSADM.STD_NTRQUALIFIERHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NTRQualifierHistory
after DELETE
ON SDSADM.STD_NTRQUALIFIERHISTORY
BEGIN
	-- update the table for STD_NTRQualifierHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRQualifierHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NTRQualifierHistory
after INSERT
ON SDSADM.STD_NTRQUALIFIERHISTORY
BEGIN
	-- update the table for STD_NTRQualifierHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRQualifierHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NTRQualifierHistory
after UPDATE
ON SDSADM.STD_NTRQUALIFIERHISTORY
BEGIN
	-- update the table for STD_NTRQualifierHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRQualifierHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NTRQUALIFIERHISTORY FOR SDSADM.STD_NTRQUALIFIERHISTORY;


ALTER TABLE SDSADM.STD_NTRQUALIFIERHISTORY ADD (
  CONSTRAINT PK_STD_NTRQUALIFIERHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NTRQUALIFIERHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_NTRQUALIFIERHISTORY ADD (
  CONSTRAINT FKSTD_NTRQUALIFIERHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_NTRQUALIFIER (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NTRQUALIFIERHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIERHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIERHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIERHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NTRQUALIFIERHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIERHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NTRQUALIFIERHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIERHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIERHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NTRQUALIFIER
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NTRQUALIFIER CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NTRQUALIFIER
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NTRQUALIFIER ON SDSADM.STD_NTRQUALIFIER
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NTRQUALIFIERCODE ON SDSADM.STD_NTRQUALIFIER
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NTRQUALIFIERNAME ON SDSADM.STD_NTRQUALIFIER
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NTRQualifier
after DELETE
ON SDSADM.STD_NTRQUALIFIER
BEGIN
	-- update the table for STD_NTRQualifier operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRQualifier';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NTRQualifier
after INSERT
ON SDSADM.STD_NTRQUALIFIER
BEGIN
	-- update the table for STD_NTRQualifier operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRQualifier';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NTRQualifier
after UPDATE
ON SDSADM.STD_NTRQUALIFIER
BEGIN
	-- update the table for STD_NTRQualifier operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NTRQualifier';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NTRQUALIFIER FOR SDSADM.STD_NTRQUALIFIER;


ALTER TABLE SDSADM.STD_NTRQUALIFIER ADD (
  CONSTRAINT PK_STD_NTRQUALIFIER
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NTRQUALIFIER
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NTRQUALIFIERCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_NTRQUALIFIERCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NTRQUALIFIERNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_NTRQUALIFIERNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NTRQUALIFIER TO ADR;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIER TO ADREXT;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIER TO EESRV;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIER TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NTRQUALIFIER TO LOBR;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIER TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NTRQUALIFIER TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIER TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NTRQUALIFIER TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NPPESORGALTRSNHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NPPESORGALTRSNHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NPPESORGALTRSNHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NPPESORGALTRSNHISTORY ON SDSADM.STD_NPPESORGALTRSNHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NPPESOrgAltRsnHistory
after DELETE
ON SDSADM.STD_NPPESORGALTRSNHISTORY
BEGIN
	-- update the table for STD_NPPESOrgAltRsnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltRsnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NPPESOrgAltRsnHistory
after INSERT
ON SDSADM.STD_NPPESORGALTRSNHISTORY
BEGIN
	-- update the table for STD_NPPESOrgAltRsnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltRsnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NPPESOrgAltRsnHistory
after UPDATE
ON SDSADM.STD_NPPESORGALTRSNHISTORY
BEGIN
	-- update the table for STD_NPPESOrgAltRsnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltRsnHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NPPESORGALTRSNHISTORY FOR SDSADM.STD_NPPESORGALTRSNHISTORY;


ALTER TABLE SDSADM.STD_NPPESORGALTRSNHISTORY ADD (
  CONSTRAINT PK_STD_NPPESORGALTRSNHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NPPESORGALTRSNHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_NPPESORGALTRSNHISTORY ADD (
  CONSTRAINT FKSTD_NPPESORGALTRSNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_NPPESORGALTRSN (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NPPESORGALTRSNHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSNHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSNHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSNHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NPPESORGALTRSNHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSNHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NPPESORGALTRSNHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSNHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSNHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NPPESORGALTRSN
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NPPESORGALTRSN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NPPESORGALTRSN
(
  ID                NUMBER(20)                  NOT NULL,
  REASONCODE        NUMBER(10)                  NOT NULL,
  SHORTDESCRIPTION  VARCHAR2(30 BYTE),
  LONGDESCRIPTION   VARCHAR2(60 BYTE),
  VERSION           INTEGER                     NOT NULL,
  CREATED           TIMESTAMP(6)                NOT NULL,
  UPDATED           TIMESTAMP(6),
  CREATEDBY         VARCHAR2(32 BYTE)           NOT NULL,
  UPDATEDBY         VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NPPESORGALTRSN ON SDSADM.STD_NPPESORGALTRSN
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NPPESORGALTRSNREASONCODE ON SDSADM.STD_NPPESORGALTRSN
(REASONCODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NPPESOrgAltRsn
after DELETE
ON SDSADM.STD_NPPESORGALTRSN
BEGIN
	-- update the table for STD_NPPESOrgAltRsn operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltRsn';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NPPESOrgAltRsn
after INSERT
ON SDSADM.STD_NPPESORGALTRSN
BEGIN
	-- update the table for STD_NPPESOrgAltRsn operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltRsn';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NPPESOrgAltRsn
after UPDATE
ON SDSADM.STD_NPPESORGALTRSN
BEGIN
	-- update the table for STD_NPPESOrgAltRsn operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltRsn';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NPPESORGALTRSN FOR SDSADM.STD_NPPESORGALTRSN;


ALTER TABLE SDSADM.STD_NPPESORGALTRSN ADD (
  CONSTRAINT PK_STD_NPPESORGALTRSN
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NPPESORGALTRSN
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NPPESORGALTRSNREASONCODE
  UNIQUE (REASONCODE)
  USING INDEX SDSADM.UQSTD_NPPESORGALTRSNREASONCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NPPESORGALTRSN TO ADR;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSN TO ADREXT;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSN TO EESRV;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSN TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NPPESORGALTRSN TO LOBR;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSN TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NPPESORGALTRSN TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSN TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NPPESORGALTRSN TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NPPESORGALTIDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NPPESORGALTIDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NPPESORGALTIDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NPPESORGALTIDHISTORY ON SDSADM.STD_NPPESORGALTIDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NPPESOrgAltIdHistory
after DELETE
ON SDSADM.STD_NPPESORGALTIDHISTORY
BEGIN
	-- update the table for STD_NPPESOrgAltIdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltIdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NPPESOrgAltIdHistory
after INSERT
ON SDSADM.STD_NPPESORGALTIDHISTORY
BEGIN
	-- update the table for STD_NPPESOrgAltIdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltIdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NPPESOrgAltIdHistory
after UPDATE
ON SDSADM.STD_NPPESORGALTIDHISTORY
BEGIN
	-- update the table for STD_NPPESOrgAltIdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltIdHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NPPESORGALTIDHISTORY FOR SDSADM.STD_NPPESORGALTIDHISTORY;


ALTER TABLE SDSADM.STD_NPPESORGALTIDHISTORY ADD (
  CONSTRAINT PK_STD_NPPESORGALTIDHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NPPESORGALTIDHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_NPPESORGALTIDHISTORY ADD (
  CONSTRAINT FKSTD_NPPESORGALTIDHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_NPPESORGALTID (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NPPESORGALTIDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_NPPESORGALTIDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_NPPESORGALTIDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_NPPESORGALTIDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NPPESORGALTIDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_NPPESORGALTIDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NPPESORGALTIDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NPPESORGALTIDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NPPESORGALTIDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NPPESORGALTID
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NPPESORGALTID CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NPPESORGALTID
(
  ID                NUMBER(20)                  NOT NULL,
  TYPECODE          NUMBER(10)                  NOT NULL,
  SHORTDESCRIPTION  VARCHAR2(30 BYTE),
  LONGDESCRIPTION   VARCHAR2(60 BYTE),
  VERSION           INTEGER                     NOT NULL,
  CREATED           TIMESTAMP(6)                NOT NULL,
  UPDATED           TIMESTAMP(6),
  CREATEDBY         VARCHAR2(32 BYTE)           NOT NULL,
  UPDATEDBY         VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NPPESORGALTID ON SDSADM.STD_NPPESORGALTID
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NPPESORGALTIDTYPECODE ON SDSADM.STD_NPPESORGALTID
(TYPECODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NPPESOrgAltId
after DELETE
ON SDSADM.STD_NPPESORGALTID
BEGIN
	-- update the table for STD_NPPESOrgAltId operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltId';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NPPESOrgAltId
after INSERT
ON SDSADM.STD_NPPESORGALTID
BEGIN
	-- update the table for STD_NPPESOrgAltId operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltId';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NPPESOrgAltId
after UPDATE
ON SDSADM.STD_NPPESORGALTID
BEGIN
	-- update the table for STD_NPPESOrgAltId operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAltId';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NPPESORGALTID FOR SDSADM.STD_NPPESORGALTID;


ALTER TABLE SDSADM.STD_NPPESORGALTID ADD (
  CONSTRAINT PK_STD_NPPESORGALTID
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NPPESORGALTID
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NPPESORGALTIDTYPECODE
  UNIQUE (TYPECODE)
  USING INDEX SDSADM.UQSTD_NPPESORGALTIDTYPECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NPPESORGALTID TO ADR;

GRANT SELECT ON SDSADM.STD_NPPESORGALTID TO ADREXT;

GRANT SELECT ON SDSADM.STD_NPPESORGALTID TO EESRV;

GRANT SELECT ON SDSADM.STD_NPPESORGALTID TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NPPESORGALTID TO LOBR;

GRANT SELECT ON SDSADM.STD_NPPESORGALTID TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NPPESORGALTID TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NPPESORGALTID TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NPPESORGALTID TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NPPESORGALIASTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NPPESORGALIASTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NPPESORGALIASTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NPPESORGALIASTYPEHSTRY ON SDSADM.STD_NPPESORGALIASTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NPPESOrgAliasTypHstry
after DELETE
ON SDSADM.STD_NPPESORGALIASTYPEHISTORY
BEGIN
	-- update the table for STD_NPPESOrgAliasTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAliasTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NPPESOrgAliasTypHstry
after INSERT
ON SDSADM.STD_NPPESORGALIASTYPEHISTORY
BEGIN
	-- update the table for STD_NPPESOrgAliasTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAliasTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NPPESOrgAliasTypHstry
after UPDATE
ON SDSADM.STD_NPPESORGALIASTYPEHISTORY
BEGIN
	-- update the table for STD_NPPESOrgAliasTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAliasTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NPPESORGALIASTYPEHISTORY FOR SDSADM.STD_NPPESORGALIASTYPEHISTORY;


ALTER TABLE SDSADM.STD_NPPESORGALIASTYPEHISTORY ADD (
  CONSTRAINT PK_STD_NPPESORGALIASTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NPPESORGALIASTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_NPPESORGALIASTYPEHISTORY ADD (
  CONSTRAINT FKSTD_NPPESORGALSTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_NPPESORGALIASTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NPPESORGALIASTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NPPESORGALIASTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NPPESORGALIASTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NPPESORGALIASTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NPPESORGALIASTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NPPESORGALIASTYPE
(
  ID                NUMBER(20)                  NOT NULL,
  ALIASTYPECODE     NUMBER(10)                  NOT NULL,
  SHORTDESCRIPTION  VARCHAR2(30 BYTE),
  LONGDESCRIPTION   VARCHAR2(60 BYTE),
  VERSION           INTEGER                     NOT NULL,
  CREATED           TIMESTAMP(6)                NOT NULL,
  UPDATED           TIMESTAMP(6),
  CREATEDBY         VARCHAR2(32 BYTE)           NOT NULL,
  UPDATEDBY         VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NPPESORGALIASTYPE ON SDSADM.STD_NPPESORGALIASTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NPPESORGALIASTYPALSTYPCD ON SDSADM.STD_NPPESORGALIASTYPE
(ALIASTYPECODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NPPESOrgAliasType
after DELETE
ON SDSADM.STD_NPPESORGALIASTYPE
BEGIN
	-- update the table for STD_NPPESOrgAliasType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAliasType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NPPESOrgAliasType
after INSERT
ON SDSADM.STD_NPPESORGALIASTYPE
BEGIN
	-- update the table for STD_NPPESOrgAliasType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAliasType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NPPESOrgAliasType
after UPDATE
ON SDSADM.STD_NPPESORGALIASTYPE
BEGIN
	-- update the table for STD_NPPESOrgAliasType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NPPESOrgAliasType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NPPESORGALIASTYPE FOR SDSADM.STD_NPPESORGALIASTYPE;


ALTER TABLE SDSADM.STD_NPPESORGALIASTYPE ADD (
  CONSTRAINT PK_STD_NPPESORGALIASTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NPPESORGALIASTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NPPESORGALIASTYPALSTYPCD
  UNIQUE (ALIASTYPECODE)
  USING INDEX SDSADM.UQSTD_NPPESORGALIASTYPALSTYPCD
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NPPESORGALIASTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NPPESORGALIASTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NPPESORGALIASTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NPPESORGALIASTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NOSITEUPLOADREASONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NOSITEUPLOADREASONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NOSITEUPLOADREASONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NOSITEUPLOADREASONHSTRY ON SDSADM.STD_NOSITEUPLOADREASONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NoSiteUploadRsnHstry
after DELETE
ON SDSADM.STD_NOSITEUPLOADREASONHISTORY
BEGIN
	-- update the table for STD_NoSiteUploadReasonHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NoSiteUploadReasonHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NoSiteUploadRsnHstry
after INSERT
ON SDSADM.STD_NOSITEUPLOADREASONHISTORY
BEGIN
	-- update the table for STD_NoSiteUploadReasonHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NoSiteUploadReasonHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NoSiteUploadRsnHstry
after UPDATE
ON SDSADM.STD_NOSITEUPLOADREASONHISTORY
BEGIN
	-- update the table for STD_NoSiteUploadReasonHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NoSiteUploadReasonHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NOSITEUPLOADREASONHISTORY FOR SDSADM.STD_NOSITEUPLOADREASONHISTORY;


ALTER TABLE SDSADM.STD_NOSITEUPLOADREASONHISTORY ADD (
  CONSTRAINT PK_STD_NOSITEUPLOADREASONHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NOSITEUPLOADREASONHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_NOSITEUPLOADREASONHISTORY ADD (
  CONSTRAINT FKSTD_NOSITEUPLOADRSNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_NOSITEUPLOADREASON (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NOSITEUPLOADREASONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NOSITEUPLOADREASONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NOSITEUPLOADREASONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NOSITEUPLOADREASON
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NOSITEUPLOADREASON CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NOSITEUPLOADREASON
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NOSITEUPLOADREASON ON SDSADM.STD_NOSITEUPLOADREASON
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NOSITEUPLOADREASONCODE ON SDSADM.STD_NOSITEUPLOADREASON
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NOSITEUPLOADREASONNAME ON SDSADM.STD_NOSITEUPLOADREASON
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NoSiteUploadReason
after DELETE
ON SDSADM.STD_NOSITEUPLOADREASON
BEGIN
	-- update the table for STD_NoSiteUploadReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NoSiteUploadReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NoSiteUploadReason
after INSERT
ON SDSADM.STD_NOSITEUPLOADREASON
BEGIN
	-- update the table for STD_NoSiteUploadReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NoSiteUploadReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NoSiteUploadReason
after UPDATE
ON SDSADM.STD_NOSITEUPLOADREASON
BEGIN
	-- update the table for STD_NoSiteUploadReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NoSiteUploadReason';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NOSITEUPLOADREASON FOR SDSADM.STD_NOSITEUPLOADREASON;


ALTER TABLE SDSADM.STD_NOSITEUPLOADREASON ADD (
  CONSTRAINT PK_STD_NOSITEUPLOADREASON
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NOSITEUPLOADREASON
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NOSITEUPLOADREASONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_NOSITEUPLOADREASONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NOSITEUPLOADREASONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_NOSITEUPLOADREASONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NOSITEUPLOADREASON TO ADR;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASON TO ADREXT;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASON TO EESRV;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASON TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NOSITEUPLOADREASON TO LOBR;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASON TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NOSITEUPLOADREASON TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASON TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NOSITEUPLOADREASON TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NAMETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NAMETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NAMETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NAMETYPEHISTORY ON SDSADM.STD_NAMETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NameTypeHistory
after DELETE
ON SDSADM.STD_NAMETYPEHISTORY
BEGIN
	-- update the table for STD_NameTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NameTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NameTypeHistory
after INSERT
ON SDSADM.STD_NAMETYPEHISTORY
BEGIN
	-- update the table for STD_NameTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NameTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NameTypeHistory
after UPDATE
ON SDSADM.STD_NAMETYPEHISTORY
BEGIN
	-- update the table for STD_NameTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NameTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NAMETYPEHISTORY FOR SDSADM.STD_NAMETYPEHISTORY;


ALTER TABLE SDSADM.STD_NAMETYPEHISTORY ADD (
  CONSTRAINT PK_STD_NAMETYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NAMETYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_NAMETYPEHISTORY ADD (
  CONSTRAINT FKSTD_NAMETYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_NAMETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NAMETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_NAMETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_NAMETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_NAMETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NAMETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_NAMETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NAMETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NAMETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NAMETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NAMETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NAMETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NAMETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(32 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NAMETYPE ON SDSADM.STD_NAMETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NAMETYPECODE ON SDSADM.STD_NAMETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NAMETYPENAME ON SDSADM.STD_NAMETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NameType
after DELETE
ON SDSADM.STD_NAMETYPE
BEGIN
	-- update the table for STD_NameType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NameType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NameType
after INSERT
ON SDSADM.STD_NAMETYPE
BEGIN
	-- update the table for STD_NameType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NameType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NameType
after UPDATE
ON SDSADM.STD_NAMETYPE
BEGIN
	-- update the table for STD_NameType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NameType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NAMETYPE FOR SDSADM.STD_NAMETYPE;


ALTER TABLE SDSADM.STD_NAMETYPE ADD (
  CONSTRAINT PK_STD_NAMETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NAMETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NAMETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_NAMETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NAMETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_NAMETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NAMETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_NAMETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_NAMETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_NAMETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NAMETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_NAMETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NAMETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NAMETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NAMETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NAMEDCONTINGENCYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NAMEDCONTINGENCYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NAMEDCONTINGENCYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NAMEDCONTINGENCYHISTORY ON SDSADM.STD_NAMEDCONTINGENCYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NamedContingencyHstry
after DELETE
ON SDSADM.STD_NAMEDCONTINGENCYHISTORY
BEGIN
	-- update the table for STD_NamedContingencyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NamedContingencyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NamedContingencyHstry
after INSERT
ON SDSADM.STD_NAMEDCONTINGENCYHISTORY
BEGIN
	-- update the table for STD_NamedContingencyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NamedContingencyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NamedContingencyHstry
after UPDATE
ON SDSADM.STD_NAMEDCONTINGENCYHISTORY
BEGIN
	-- update the table for STD_NamedContingencyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NamedContingencyHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NAMEDCONTINGENCYHISTORY FOR SDSADM.STD_NAMEDCONTINGENCYHISTORY;


ALTER TABLE SDSADM.STD_NAMEDCONTINGENCYHISTORY ADD (
  CONSTRAINT PK_STD_NAMEDCONTINGENCYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NAMEDCONTINGENCYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_NAMEDCONTINGENCYHISTORY ADD (
  CONSTRAINT FKSTD_NAMEDCNTNGNCYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_NAMEDCONTINGENCY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NAMEDCONTINGENCYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NAMEDCONTINGENCYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NAMEDCONTINGENCYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_NAMEDCONTINGENCY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_NAMEDCONTINGENCY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_NAMEDCONTINGENCY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(8 BYTE)                 NOT NULL,
  NAME         VARCHAR2(120 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_NAMEDCONTINGENCY ON SDSADM.STD_NAMEDCONTINGENCY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NAMEDCONTINGENCYCODE ON SDSADM.STD_NAMEDCONTINGENCY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_NAMEDCONTINGENCYNAME ON SDSADM.STD_NAMEDCONTINGENCY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_NamedContingency
after DELETE
ON SDSADM.STD_NAMEDCONTINGENCY
BEGIN
	-- update the table for STD_NamedContingency operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NamedContingency';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_NamedContingency
after INSERT
ON SDSADM.STD_NAMEDCONTINGENCY
BEGIN
	-- update the table for STD_NamedContingency operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NamedContingency';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_NamedContingency
after UPDATE
ON SDSADM.STD_NAMEDCONTINGENCY
BEGIN
	-- update the table for STD_NamedContingency operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_NamedContingency';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_NAMEDCONTINGENCY FOR SDSADM.STD_NAMEDCONTINGENCY;


ALTER TABLE SDSADM.STD_NAMEDCONTINGENCY ADD (
  CONSTRAINT PK_STD_NAMEDCONTINGENCY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_NAMEDCONTINGENCY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NAMEDCONTINGENCYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_NAMEDCONTINGENCYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_NAMEDCONTINGENCYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_NAMEDCONTINGENCYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_NAMEDCONTINGENCY TO ADR;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCY TO ADREXT;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCY TO EESRV;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_NAMEDCONTINGENCY TO LOBR;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_NAMEDCONTINGENCY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_NAMEDCONTINGENCY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MTNOTREQRSNTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MTNOTREQRSNTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MTNOTREQRSNTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MTNOTREQRSNTYPEHISTORY ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MTNotReqRsnTypeHstry
after DELETE
ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY
BEGIN
	-- update the table for STD_MTNotReqRsnTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MTNotReqRsnTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MTNotReqRsnTypeHstry
after INSERT
ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY
BEGIN
	-- update the table for STD_MTNotReqRsnTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MTNotReqRsnTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MTNotReqRsnTypeHstry
after UPDATE
ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY
BEGIN
	-- update the table for STD_MTNotReqRsnTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MTNotReqRsnTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MTNOTREQRSNTYPEHISTORY FOR SDSADM.STD_MTNOTREQRSNTYPEHISTORY;


ALTER TABLE SDSADM.STD_MTNOTREQRSNTYPEHISTORY ADD (
  CONSTRAINT PK_STD_MTNOTREQRSNTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MTNOTREQRSNTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MTNOTREQRSNTYPEHISTORY ADD (
  CONSTRAINT FKSTD_MTNOTREQRSNTYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MTNOTREQRSNTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MTNOTREQRSNTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MTNOTREQRSNTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MTNOTREQRSNTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(60 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MTNOTREQRSNTYPE ON SDSADM.STD_MTNOTREQRSNTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MTNOTREQRSNTYPECODE ON SDSADM.STD_MTNOTREQRSNTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MTNOTREQRSNTYPENAME ON SDSADM.STD_MTNOTREQRSNTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MTNotReqRsnType
after DELETE
ON SDSADM.STD_MTNOTREQRSNTYPE
BEGIN
	-- update the table for STD_MTNotReqRsnType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MTNotReqRsnType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MTNotReqRsnType
after INSERT
ON SDSADM.STD_MTNOTREQRSNTYPE
BEGIN
	-- update the table for STD_MTNotReqRsnType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MTNotReqRsnType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MTNotReqRsnType
after UPDATE
ON SDSADM.STD_MTNOTREQRSNTYPE
BEGIN
	-- update the table for STD_MTNotReqRsnType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MTNotReqRsnType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MTNOTREQRSNTYPE FOR SDSADM.STD_MTNOTREQRSNTYPE;


ALTER TABLE SDSADM.STD_MTNOTREQRSNTYPE ADD (
  CONSTRAINT PK_STD_MTNOTREQRSNTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MTNOTREQRSNTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MTNOTREQRSNTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MTNOTREQRSNTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MTNOTREQRSNTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MTNOTREQRSNTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MTNOTREQRSNTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MTNOTREQRSNTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MTNOTREQRSNTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MTNOTREQRSNTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MSTSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MSTSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MSTSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MSTSTATUSHISTORY ON SDSADM.STD_MSTSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MSTStatusHistory
after DELETE
ON SDSADM.STD_MSTSTATUSHISTORY
BEGIN
	-- update the table for STD_MSTStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSTStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MSTStatusHistory
after INSERT
ON SDSADM.STD_MSTSTATUSHISTORY
BEGIN
	-- update the table for STD_MSTStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSTStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MSTStatusHistory
after UPDATE
ON SDSADM.STD_MSTSTATUSHISTORY
BEGIN
	-- update the table for STD_MSTStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSTStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MSTSTATUSHISTORY FOR SDSADM.STD_MSTSTATUSHISTORY;


ALTER TABLE SDSADM.STD_MSTSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_MSTSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MSTSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MSTSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_MSTSTATUSHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MSTSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MSTSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MSTSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MSTSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MSTSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MSTSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MSTSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MSTSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MSTSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MSTSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MSTSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MSTSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MSTSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(1 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MSTSTATUS ON SDSADM.STD_MSTSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MSTSTATUSCODE ON SDSADM.STD_MSTSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MSTSTATUSNAME ON SDSADM.STD_MSTSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MSTStatus
after DELETE
ON SDSADM.STD_MSTSTATUS
BEGIN
	-- update the table for STD_MSTStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSTStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MSTStatus
after INSERT
ON SDSADM.STD_MSTSTATUS
BEGIN
	-- update the table for STD_MSTStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSTStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MSTStatus
after UPDATE
ON SDSADM.STD_MSTSTATUS
BEGIN
	-- update the table for STD_MSTStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSTStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MSTSTATUS FOR SDSADM.STD_MSTSTATUS;


ALTER TABLE SDSADM.STD_MSTSTATUS ADD (
  CONSTRAINT PK_STD_MSTSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MSTSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MSTSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MSTSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MSTSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MSTSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MSTSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_MSTSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_MSTSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_MSTSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MSTSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_MSTSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MSTSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MSTSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MSTSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MSDSCOUNTRYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MSDSCOUNTRYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MSDSCOUNTRYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MSDSCOUNTRYHISTORY ON SDSADM.STD_MSDSCOUNTRYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MSDSCountryHistory
after DELETE
ON SDSADM.STD_MSDSCOUNTRYHISTORY
BEGIN
	-- update the table for STD_MSDSCountryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSDSCountryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MSDSCountryHistory
after INSERT
ON SDSADM.STD_MSDSCOUNTRYHISTORY
BEGIN
	-- update the table for STD_MSDSCountryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSDSCountryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MSDSCountryHistory
after UPDATE
ON SDSADM.STD_MSDSCOUNTRYHISTORY
BEGIN
	-- update the table for STD_MSDSCountryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSDSCountryHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MSDSCOUNTRYHISTORY FOR SDSADM.STD_MSDSCOUNTRYHISTORY;


ALTER TABLE SDSADM.STD_MSDSCOUNTRYHISTORY ADD (
  CONSTRAINT PK_STD_MSDSCOUNTRYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MSDSCOUNTRYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MSDSCOUNTRYHISTORY ADD (
  CONSTRAINT FKSTD_MSDSCOUNTRYHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MSDSCOUNTRY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MSDSCOUNTRYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MSDSCOUNTRYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MSDSCOUNTRYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MSDSCOUNTRY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MSDSCOUNTRY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MSDSCOUNTRY
(
  ID            NUMBER(20)                      NOT NULL,
  CODE          VARCHAR2(2 BYTE)                NOT NULL,
  COUNTRY_NAME  VARCHAR2(55 BYTE)               NOT NULL,
  DESCRIPTION   VARCHAR2(200 BYTE),
  ISACTIVE      NUMBER(10)                      NOT NULL,
  VERSION       INTEGER                         NOT NULL,
  CREATED       TIMESTAMP(6)                    NOT NULL,
  UPDATED       TIMESTAMP(6),
  CREATEDBY     VARCHAR2(32 BYTE)               NOT NULL,
  UPDATEDBY     VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MSDSCOUNTRY ON SDSADM.STD_MSDSCOUNTRY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MSDSCOUNTRYCODE ON SDSADM.STD_MSDSCOUNTRY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MSDSCountry
after DELETE
ON SDSADM.STD_MSDSCOUNTRY
BEGIN
	-- update the table for STD_MSDSCountry operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSDSCountry';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MSDSCountry
after INSERT
ON SDSADM.STD_MSDSCOUNTRY
BEGIN
	-- update the table for STD_MSDSCountry operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSDSCountry';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MSDSCountry
after UPDATE
ON SDSADM.STD_MSDSCOUNTRY
BEGIN
	-- update the table for STD_MSDSCountry operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MSDSCountry';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MSDSCOUNTRY FOR SDSADM.STD_MSDSCOUNTRY;


ALTER TABLE SDSADM.STD_MSDSCOUNTRY ADD (
  CONSTRAINT PK_STD_MSDSCOUNTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MSDSCOUNTRY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MSDSCOUNTRYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MSDSCOUNTRYCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MSDSCOUNTRY TO ADR;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRY TO EESRV;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MSDSCOUNTRY TO LOBR;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MSDSCOUNTRY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MSDSCOUNTRY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MONETARYBENEFITTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MONETARYBENEFITTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MONETARYBENEFITTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MONETARYBENEFITTYPHSTRY ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MonetaryBnftTypHstry
after DELETE
ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY
BEGIN
	-- update the table for STD_MonetaryBenefitTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MonetaryBenefitTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MonetaryBnftTypHstry
after INSERT
ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY
BEGIN
	-- update the table for STD_MonetaryBenefitTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MonetaryBenefitTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MonetaryBnftTypHstry
after UPDATE
ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY
BEGIN
	-- update the table for STD_MonetaryBenefitTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MonetaryBenefitTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MONETARYBENEFITTYPEHISTORY FOR SDSADM.STD_MONETARYBENEFITTYPEHISTORY;


ALTER TABLE SDSADM.STD_MONETARYBENEFITTYPEHISTORY ADD (
  CONSTRAINT PK_STD_MONETARYBENEFITTYPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MONETARYBENEFITTYPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MONETARYBENEFITTYPEHISTORY ADD (
  CONSTRAINT FKSTD_MONETARYBNFTTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MONETARYBENEFITTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MONETARYBENEFITTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MONETARYBENEFITTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MONETARYBENEFITTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MONETARYBENEFITTYPE ON SDSADM.STD_MONETARYBENEFITTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MONETARYBENEFITTYPECODE ON SDSADM.STD_MONETARYBENEFITTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MONETARYBENEFITTYPENAME ON SDSADM.STD_MONETARYBENEFITTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MonetaryBenefitType
after DELETE
ON SDSADM.STD_MONETARYBENEFITTYPE
BEGIN
	-- update the table for STD_MonetaryBenefitType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MonetaryBenefitType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MonetaryBenefitType
after INSERT
ON SDSADM.STD_MONETARYBENEFITTYPE
BEGIN
	-- update the table for STD_MonetaryBenefitType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MonetaryBenefitType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MonetaryBenefitType
after UPDATE
ON SDSADM.STD_MONETARYBENEFITTYPE
BEGIN
	-- update the table for STD_MonetaryBenefitType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MonetaryBenefitType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MONETARYBENEFITTYPE FOR SDSADM.STD_MONETARYBENEFITTYPE;


ALTER TABLE SDSADM.STD_MONETARYBENEFITTYPE ADD (
  CONSTRAINT PK_STD_MONETARYBENEFITTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MONETARYBENEFITTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MONETARYBENEFITTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MONETARYBENEFITTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MONETARYBENEFITTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MONETARYBENEFITTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MONETARYBENEFITTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MONETARYBENEFITTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MONETARYBENEFITTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MONETARYBENEFITTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MILITARYSVCQRYSTATHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MILITARYSVCQRYSTATHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MILITARYSVCQRYSTATHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MILITARYSVCQRYSTATHSTRY ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MltrySvcQrySttHstry
after DELETE
ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY
BEGIN
	-- update the table for STD_MilitarySvcQryStatHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcQryStatHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MltrySvcQrySttHstry
after INSERT
ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY
BEGIN
	-- update the table for STD_MilitarySvcQryStatHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcQryStatHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MltrySvcQrySttHstry
after UPDATE
ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY
BEGIN
	-- update the table for STD_MilitarySvcQryStatHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcQryStatHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MILITARYSVCQRYSTATHISTORY FOR SDSADM.STD_MILITARYSVCQRYSTATHISTORY;


ALTER TABLE SDSADM.STD_MILITARYSVCQRYSTATHISTORY ADD (
  CONSTRAINT PK_STD_MILITARYSVCQRYSTATHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MILITARYSVCQRYSTATHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MILITARYSVCQRYSTATHISTORY ADD (
  CONSTRAINT FKSTD_MLTRYSVCQRYSTTHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MILITARYSVCQRYSTAT (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTATHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MILITARYSVCQRYSTAT
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MILITARYSVCQRYSTAT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MILITARYSVCQRYSTAT
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(8 BYTE)                 NOT NULL,
  NAME         VARCHAR2(35 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MILITARYSVCQRYSTAT ON SDSADM.STD_MILITARYSVCQRYSTAT
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MILITARYSVCQRYSTATCODE ON SDSADM.STD_MILITARYSVCQRYSTAT
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MILITARYSVCQRYSTATNAME ON SDSADM.STD_MILITARYSVCQRYSTAT
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MilitarySvcQryStat
after DELETE
ON SDSADM.STD_MILITARYSVCQRYSTAT
BEGIN
	-- update the table for STD_MilitarySvcQryStat operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcQryStat';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MilitarySvcQryStat
after INSERT
ON SDSADM.STD_MILITARYSVCQRYSTAT
BEGIN
	-- update the table for STD_MilitarySvcQryStat operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcQryStat';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MilitarySvcQryStat
after UPDATE
ON SDSADM.STD_MILITARYSVCQRYSTAT
BEGIN
	-- update the table for STD_MilitarySvcQryStat operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcQryStat';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MILITARYSVCQRYSTAT FOR SDSADM.STD_MILITARYSVCQRYSTAT;


ALTER TABLE SDSADM.STD_MILITARYSVCQRYSTAT ADD (
  CONSTRAINT PK_STD_MILITARYSVCQRYSTAT
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MILITARYSVCQRYSTAT
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MILITARYSVCQRYSTATCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MILITARYSVCQRYSTATCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MILITARYSVCQRYSTATNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MILITARYSVCQRYSTATNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MILITARYSVCQRYSTAT TO ADR;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTAT TO ADREXT;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTAT TO EESRV;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTAT TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MILITARYSVCQRYSTAT TO LOBR;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTAT TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MILITARYSVCQRYSTAT TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTAT TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MILITARYSVCQRYSTAT TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MILITARYSVCCOMPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MILITARYSVCCOMPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MILITARYSVCCOMPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MILITARYSVCCOMPHISTORY ON SDSADM.STD_MILITARYSVCCOMPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MilitarySvcCompHstry
after DELETE
ON SDSADM.STD_MILITARYSVCCOMPHISTORY
BEGIN
	-- update the table for STD_MilitarySvcCompHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcCompHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MilitarySvcCompHstry
after INSERT
ON SDSADM.STD_MILITARYSVCCOMPHISTORY
BEGIN
	-- update the table for STD_MilitarySvcCompHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcCompHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MilitarySvcCompHstry
after UPDATE
ON SDSADM.STD_MILITARYSVCCOMPHISTORY
BEGIN
	-- update the table for STD_MilitarySvcCompHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcCompHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MILITARYSVCCOMPHISTORY FOR SDSADM.STD_MILITARYSVCCOMPHISTORY;


ALTER TABLE SDSADM.STD_MILITARYSVCCOMPHISTORY ADD (
  CONSTRAINT PK_STD_MILITARYSVCCOMPHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MILITARYSVCCOMPHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MILITARYSVCCOMPHISTORY ADD (
  CONSTRAINT FKSTD_MILITARYSVCCOMPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MILITARYSVCCOMP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MILITARYSVCCOMPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MILITARYSVCCOMPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MILITARYSVCCOMPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MILITARYSVCCOMP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MILITARYSVCCOMP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MILITARYSVCCOMP
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MILITARYSVCCOMP ON SDSADM.STD_MILITARYSVCCOMP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MILITARYSVCCOMPCODE ON SDSADM.STD_MILITARYSVCCOMP
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MILITARYSVCCOMPNAME ON SDSADM.STD_MILITARYSVCCOMP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MilitarySvcComp
after DELETE
ON SDSADM.STD_MILITARYSVCCOMP
BEGIN
	-- update the table for STD_MilitarySvcComp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcComp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MilitarySvcComp
after INSERT
ON SDSADM.STD_MILITARYSVCCOMP
BEGIN
	-- update the table for STD_MilitarySvcComp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcComp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MilitarySvcComp
after UPDATE
ON SDSADM.STD_MILITARYSVCCOMP
BEGIN
	-- update the table for STD_MilitarySvcComp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilitarySvcComp';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MILITARYSVCCOMP FOR SDSADM.STD_MILITARYSVCCOMP;


ALTER TABLE SDSADM.STD_MILITARYSVCCOMP ADD (
  CONSTRAINT PK_STD_MILITARYSVCCOMP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MILITARYSVCCOMP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MILITARYSVCCOMPCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MILITARYSVCCOMPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MILITARYSVCCOMPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MILITARYSVCCOMPNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MILITARYSVCCOMP TO ADR;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMP TO ADREXT;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMP TO EESRV;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MILITARYSVCCOMP TO LOBR;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MILITARYSVCCOMP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MILITARYSVCCOMP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MILHISTORYTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MILHISTORYTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MILHISTORYTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MILHISTORYTYPEHISTORY ON SDSADM.STD_MILHISTORYTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MilHistoryTypeHistory
after DELETE
ON SDSADM.STD_MILHISTORYTYPEHISTORY
BEGIN
	-- update the table for STD_MilHistoryTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilHistoryTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MilHistoryTypeHistory
after INSERT
ON SDSADM.STD_MILHISTORYTYPEHISTORY
BEGIN
	-- update the table for STD_MilHistoryTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilHistoryTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MilHistoryTypeHistory
after UPDATE
ON SDSADM.STD_MILHISTORYTYPEHISTORY
BEGIN
	-- update the table for STD_MilHistoryTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilHistoryTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MILHISTORYTYPEHISTORY FOR SDSADM.STD_MILHISTORYTYPEHISTORY;


ALTER TABLE SDSADM.STD_MILHISTORYTYPEHISTORY ADD (
  CONSTRAINT PK_STD_MILHISTORYTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MILHISTORYTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MILHISTORYTYPEHISTORY ADD (
  CONSTRAINT FKSTD_MILHISTORYTYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MILHISTORYTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MILHISTORYTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MILHISTORYTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MILHISTORYTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MILHISTORYTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MILHISTORYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MILHISTORYTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(40 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MILHISTORYTYPE ON SDSADM.STD_MILHISTORYTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MILHISTORYTYPECODE ON SDSADM.STD_MILHISTORYTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MILHISTORYTYPENAME ON SDSADM.STD_MILHISTORYTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MilHistoryType
after DELETE
ON SDSADM.STD_MILHISTORYTYPE
BEGIN
	-- update the table for STD_MilHistoryType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilHistoryType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MilHistoryType
after INSERT
ON SDSADM.STD_MILHISTORYTYPE
BEGIN
	-- update the table for STD_MilHistoryType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilHistoryType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MilHistoryType
after UPDATE
ON SDSADM.STD_MILHISTORYTYPE
BEGIN
	-- update the table for STD_MilHistoryType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MilHistoryType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MILHISTORYTYPE FOR SDSADM.STD_MILHISTORYTYPE;


ALTER TABLE SDSADM.STD_MILHISTORYTYPE ADD (
  CONSTRAINT PK_STD_MILHISTORYTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MILHISTORYTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MILHISTORYTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MILHISTORYTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MILHISTORYTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MILHISTORYTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MILHISTORYTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MILHISTORYTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MILHISTORYTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MILHISTORYTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MHDATASOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MHDATASOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MHDATASOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MHDATASOURCEHISTORY ON SDSADM.STD_MHDATASOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MHDataSourceHistory
after DELETE
ON SDSADM.STD_MHDATASOURCEHISTORY
BEGIN
	-- update the table for STD_MHDataSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MHDataSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MHDataSourceHistory
after INSERT
ON SDSADM.STD_MHDATASOURCEHISTORY
BEGIN
	-- update the table for STD_MHDataSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MHDataSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MHDataSourceHistory
after UPDATE
ON SDSADM.STD_MHDATASOURCEHISTORY
BEGIN
	-- update the table for STD_MHDataSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MHDataSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MHDATASOURCEHISTORY FOR SDSADM.STD_MHDATASOURCEHISTORY;


ALTER TABLE SDSADM.STD_MHDATASOURCEHISTORY ADD (
  CONSTRAINT PK_STD_MHDATASOURCEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MHDATASOURCEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MHDATASOURCEHISTORY ADD (
  CONSTRAINT FKSTD_MHDATASOURCEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MHDATASOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MHDATASOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MHDATASOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MHDATASOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MHDATASOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MHDATASOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MHDATASOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MHDATASOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MHDATASOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MHDATASOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MHDATASOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MHDATASOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MHDATASOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(8 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MHDATASOURCE ON SDSADM.STD_MHDATASOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MHDATASOURCECODE ON SDSADM.STD_MHDATASOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MHDATASOURCENAME ON SDSADM.STD_MHDATASOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MHDataSource
after DELETE
ON SDSADM.STD_MHDATASOURCE
BEGIN
	-- update the table for STD_MHDataSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MHDataSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MHDataSource
after INSERT
ON SDSADM.STD_MHDATASOURCE
BEGIN
	-- update the table for STD_MHDataSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MHDataSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MHDataSource
after UPDATE
ON SDSADM.STD_MHDATASOURCE
BEGIN
	-- update the table for STD_MHDataSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MHDataSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MHDATASOURCE FOR SDSADM.STD_MHDATASOURCE;


ALTER TABLE SDSADM.STD_MHDATASOURCE ADD (
  CONSTRAINT PK_STD_MHDATASOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MHDATASOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MHDATASOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MHDATASOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MHDATASOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MHDATASOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MHDATASOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_MHDATASOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_MHDATASOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_MHDATASOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MHDATASOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_MHDATASOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MHDATASOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MHDATASOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MHDATASOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MESSAGETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MESSAGETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MESSAGETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MESSAGETYPEHISTORY ON SDSADM.STD_MESSAGETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MessageTypeHistory
after DELETE
ON SDSADM.STD_MESSAGETYPEHISTORY
BEGIN
	-- update the table for STD_MessageTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MessageTypeHistory
after INSERT
ON SDSADM.STD_MESSAGETYPEHISTORY
BEGIN
	-- update the table for STD_MessageTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MessageTypeHistory
after UPDATE
ON SDSADM.STD_MESSAGETYPEHISTORY
BEGIN
	-- update the table for STD_MessageTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MESSAGETYPEHISTORY FOR SDSADM.STD_MESSAGETYPEHISTORY;


ALTER TABLE SDSADM.STD_MESSAGETYPEHISTORY ADD (
  CONSTRAINT PK_STD_MESSAGETYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MESSAGETYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MESSAGETYPEHISTORY ADD (
  CONSTRAINT FKSTD_MESSAGETYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MESSAGETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MESSAGETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MESSAGETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MESSAGETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MESSAGETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MESSAGETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MESSAGETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MESSAGETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MESSAGETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MESSAGETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MESSAGETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MESSAGETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MESSAGETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(8 BYTE)                     NOT NULL,
  NAME         VARCHAR2(60 BYTE)                NOT NULL,
  DIRECTION    CHAR(1 BYTE)                     NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MESSAGETYPE ON SDSADM.STD_MESSAGETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MESSAGETYPECODE ON SDSADM.STD_MESSAGETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MESSAGETYPENAME ON SDSADM.STD_MESSAGETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.DEL4_STD_MESSAGETYPE
after DELETE
ON SDSADM.STD_MESSAGETYPE
BEGIN
	-- update the table for STD_MessageType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.INS4_STD_MESSAGETYPE
after INSERT
ON SDSADM.STD_MESSAGETYPE
BEGIN
	-- update the table for STD_MessageType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.UPD4_STD_MESSAGETYPE
after UPDATE
ON SDSADM.STD_MESSAGETYPE
BEGIN
	-- update the table for STD_MessageType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MESSAGETYPE FOR SDSADM.STD_MESSAGETYPE;


ALTER TABLE SDSADM.STD_MESSAGETYPE ADD (
  CONSTRAINT PK_STD_MESSAGETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MESSAGETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MESSAGETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MESSAGETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MESSAGETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MESSAGETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MESSAGETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_MESSAGETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_MESSAGETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_MESSAGETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MESSAGETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_MESSAGETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MESSAGETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MESSAGETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MESSAGETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MESSAGESTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MESSAGESTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MESSAGESTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MESSAGESTATUSHISTORY ON SDSADM.STD_MESSAGESTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MessageStatusHistory
after DELETE
ON SDSADM.STD_MESSAGESTATUSHISTORY
BEGIN
	-- update the table for STD_MessageStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MessageStatusHistory
after INSERT
ON SDSADM.STD_MESSAGESTATUSHISTORY
BEGIN
	-- update the table for STD_MessageStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MessageStatusHistory
after UPDATE
ON SDSADM.STD_MESSAGESTATUSHISTORY
BEGIN
	-- update the table for STD_MessageStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MESSAGESTATUSHISTORY FOR SDSADM.STD_MESSAGESTATUSHISTORY;


ALTER TABLE SDSADM.STD_MESSAGESTATUSHISTORY ADD (
  CONSTRAINT PK_STD_MESSAGESTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MESSAGESTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MESSAGESTATUSHISTORY ADD (
  CONSTRAINT FKSTD_MESSAGESTATUSHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MESSAGESTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MESSAGESTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MESSAGESTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MESSAGESTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MESSAGESTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MESSAGESTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MESSAGESTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MESSAGESTATUS ON SDSADM.STD_MESSAGESTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MESSAGESTATUSCODE ON SDSADM.STD_MESSAGESTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MESSAGESTATUSNAME ON SDSADM.STD_MESSAGESTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.DEL4_STD_MESSAGESTATUS
after DELETE
ON SDSADM.STD_MESSAGESTATUS
BEGIN
	-- update the table for STD_MessageStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.INS4_STD_MESSAGESTATUS
after INSERT
ON SDSADM.STD_MESSAGESTATUS
BEGIN
	-- update the table for STD_MessageStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.UPD4_STD_MESSAGESTATUS
after UPDATE
ON SDSADM.STD_MESSAGESTATUS
BEGIN
	-- update the table for STD_MessageStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MessageStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MESSAGESTATUS FOR SDSADM.STD_MESSAGESTATUS;


ALTER TABLE SDSADM.STD_MESSAGESTATUS ADD (
  CONSTRAINT PK_STD_MESSAGESTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MESSAGESTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MESSAGESTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MESSAGESTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MESSAGESTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MESSAGESTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MESSAGESTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MESSAGESTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MESSAGESTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MESSAGESTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MEANSTESTSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MEANSTESTSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MEANSTESTSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MEANSTESTSTATUSHISTORY ON SDSADM.STD_MEANSTESTSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MeansTestStatusHstry
after DELETE
ON SDSADM.STD_MEANSTESTSTATUSHISTORY
BEGIN
	-- update the table for STD_MeansTestStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MeansTestStatusHstry
after INSERT
ON SDSADM.STD_MEANSTESTSTATUSHISTORY
BEGIN
	-- update the table for STD_MeansTestStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MeansTestStatusHstry
after UPDATE
ON SDSADM.STD_MEANSTESTSTATUSHISTORY
BEGIN
	-- update the table for STD_MeansTestStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MEANSTESTSTATUSHISTORY FOR SDSADM.STD_MEANSTESTSTATUSHISTORY;


ALTER TABLE SDSADM.STD_MEANSTESTSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_MEANSTESTSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MEANSTESTSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MEANSTESTSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_MEANSTESTSTATUSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MEANSTESTSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MEANSTESTSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MEANSTESTSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MEANSTESTSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MEANSTESTSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MEANSTESTSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MEANSTESTSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(1 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MEANSTESTSTATUS ON SDSADM.STD_MEANSTESTSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MEANSTESTSTATUSCODE ON SDSADM.STD_MEANSTESTSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MEANSTESTSTATUSNAME ON SDSADM.STD_MEANSTESTSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MeansTestStatus
after DELETE
ON SDSADM.STD_MEANSTESTSTATUS
BEGIN
	-- update the table for STD_MeansTestStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MeansTestStatus
after INSERT
ON SDSADM.STD_MEANSTESTSTATUS
BEGIN
	-- update the table for STD_MeansTestStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MeansTestStatus
after UPDATE
ON SDSADM.STD_MEANSTESTSTATUS
BEGIN
	-- update the table for STD_MeansTestStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MEANSTESTSTATUS FOR SDSADM.STD_MEANSTESTSTATUS;


ALTER TABLE SDSADM.STD_MEANSTESTSTATUS ADD (
  CONSTRAINT PK_STD_MEANSTESTSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MEANSTESTSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MEANSTESTSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MEANSTESTSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MEANSTESTSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MEANSTESTSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MEANSTESTSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MEANSTESTSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MEANSTESTSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MEANSTESTSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MEANSTESTSIGSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MEANSTESTSIGSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MEANSTESTSIGSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MEANSTESTSIGSTATUSHSTRY ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MeansTestSigSttsHstry
after DELETE
ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY
BEGIN
	-- update the table for STD_MeansTestSigStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestSigStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MeansTestSigSttsHstry
after INSERT
ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY
BEGIN
	-- update the table for STD_MeansTestSigStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestSigStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MeansTestSigSttsHstry
after UPDATE
ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY
BEGIN
	-- update the table for STD_MeansTestSigStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestSigStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MEANSTESTSIGSTATUSHISTORY FOR SDSADM.STD_MEANSTESTSIGSTATUSHISTORY;


ALTER TABLE SDSADM.STD_MEANSTESTSIGSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_MEANSTESTSIGSTATUSHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MEANSTESTSIGSTATUSHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MEANSTESTSIGSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_MEANSTESTSGSTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MEANSTESTSIGSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MEANSTESTSIGSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MEANSTESTSIGSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MEANSTESTSIGSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MEANSTESTSIGSTATUS ON SDSADM.STD_MEANSTESTSIGSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MEANSTESTSIGSTATUSCODE ON SDSADM.STD_MEANSTESTSIGSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MEANSTESTSIGSTATUSNAME ON SDSADM.STD_MEANSTESTSIGSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MeansTestSigStatus
after DELETE
ON SDSADM.STD_MEANSTESTSIGSTATUS
BEGIN
	-- update the table for STD_MeansTestSigStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestSigStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MeansTestSigStatus
after INSERT
ON SDSADM.STD_MEANSTESTSIGSTATUS
BEGIN
	-- update the table for STD_MeansTestSigStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestSigStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MeansTestSigStatus
after UPDATE
ON SDSADM.STD_MEANSTESTSIGSTATUS
BEGIN
	-- update the table for STD_MeansTestSigStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MeansTestSigStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MEANSTESTSIGSTATUS FOR SDSADM.STD_MEANSTESTSIGSTATUS;


ALTER TABLE SDSADM.STD_MEANSTESTSIGSTATUS ADD (
  CONSTRAINT PK_STD_MEANSTESTSIGSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MEANSTESTSIGSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MEANSTESTSIGSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MEANSTESTSIGSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MEANSTESTSIGSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MEANSTESTSIGSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MEANSTESTSIGSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MEANSTESTSIGSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MEANSTESTSIGSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MEANSTESTSIGSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MASMTTHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MASMTTHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MASMTTHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MASMTTHISTORY ON SDSADM.STD_MASMTTHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MASMTTHistory
after DELETE
ON SDSADM.STD_MASMTTHISTORY
BEGIN
	-- update the table for STD_MASMTTHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MASMTTHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MASMTTHistory
after INSERT
ON SDSADM.STD_MASMTTHISTORY
BEGIN
	-- update the table for STD_MASMTTHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MASMTTHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MASMTTHistory
after UPDATE
ON SDSADM.STD_MASMTTHISTORY
BEGIN
	-- update the table for STD_MASMTTHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MASMTTHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MASMTTHISTORY FOR SDSADM.STD_MASMTTHISTORY;


ALTER TABLE SDSADM.STD_MASMTTHISTORY ADD (
  CONSTRAINT PK_STD_MASMTTHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MASMTTHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MASMTTHISTORY ADD (
  CONSTRAINT FKSTD_MASMTTHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MASMTTHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MASMTTHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MASMTTHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MASMTTHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MASMTTHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MASMTTHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MASMTTHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MASMTTHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MASMTTHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MASMTT ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MASMTTNAME ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MASMTT
after DELETE
ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE
BEGIN
	-- update the table for STD_MASMovementTransactionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MASMovementTransactionType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MASMTT
after INSERT
ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE
BEGIN
	-- update the table for STD_MASMovementTransactionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MASMovementTransactionType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MASMTT
after UPDATE
ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE
BEGIN
	-- update the table for STD_MASMovementTransactionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MASMovementTransactionType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MASMOVEMENTTRANSACTIONTYPE FOR SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE;


ALTER TABLE SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE ADD (
  CONSTRAINT PK_STD_MASMTT
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MASMTT
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MASMTTNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MASMTTNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MARITALSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MARITALSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MARITALSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MARITALSTATUSHISTORY ON SDSADM.STD_MARITALSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MaritalStatusHistory
after DELETE
ON SDSADM.STD_MARITALSTATUSHISTORY
BEGIN
	-- update the table for STD_MaritalStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MaritalStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MaritalStatusHistory
after INSERT
ON SDSADM.STD_MARITALSTATUSHISTORY
BEGIN
	-- update the table for STD_MaritalStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MaritalStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MaritalStatusHistory
after UPDATE
ON SDSADM.STD_MARITALSTATUSHISTORY
BEGIN
	-- update the table for STD_MaritalStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MaritalStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MARITALSTATUSHISTORY FOR SDSADM.STD_MARITALSTATUSHISTORY;


ALTER TABLE SDSADM.STD_MARITALSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_MARITALSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MARITALSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_MARITALSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_MARITALSTATUSHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_MARITALSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MARITALSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_MARITALSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_MARITALSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_MARITALSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MARITALSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_MARITALSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MARITALSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MARITALSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MARITALSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_MARITALSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_MARITALSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_MARITALSTATUS
(
  ID            NUMBER(20)                      NOT NULL,
  CODE          VARCHAR2(3 BYTE)                NOT NULL,
  NAME          VARCHAR2(30 BYTE)               NOT NULL,
  DESCRIPTION   VARCHAR2(70 BYTE),
  ABBREVIATION  VARCHAR2(5 BYTE),
  VERSION       INTEGER                         NOT NULL,
  CREATED       TIMESTAMP(6)                    NOT NULL,
  UPDATED       TIMESTAMP(6),
  CREATEDBY     VARCHAR2(32 BYTE)               NOT NULL,
  UPDATEDBY     VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_MARITALSTATUS ON SDSADM.STD_MARITALSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MARITALSTATUSCODE ON SDSADM.STD_MARITALSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_MARITALSTATUSNAME ON SDSADM.STD_MARITALSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_MaritalStatus
after DELETE
ON SDSADM.STD_MARITALSTATUS
BEGIN
	-- update the table for STD_MaritalStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MaritalStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_MaritalStatus
after INSERT
ON SDSADM.STD_MARITALSTATUS
BEGIN
	-- update the table for STD_MaritalStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MaritalStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_MaritalStatus
after UPDATE
ON SDSADM.STD_MARITALSTATUS
BEGIN
	-- update the table for STD_MaritalStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_MaritalStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_MARITALSTATUS FOR SDSADM.STD_MARITALSTATUS;


ALTER TABLE SDSADM.STD_MARITALSTATUS ADD (
  CONSTRAINT PK_STD_MARITALSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_MARITALSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MARITALSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_MARITALSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_MARITALSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_MARITALSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_MARITALSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_MARITALSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_MARITALSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_MARITALSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_MARITALSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_MARITALSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_MARITALSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_MARITALSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_MARITALSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_LOCATIONTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_LOCATIONTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_LOCATIONTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_LOCATIONTYPEHISTORY ON SDSADM.STD_LOCATIONTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_LocationTypeHistory
after DELETE
ON SDSADM.STD_LOCATIONTYPEHISTORY
BEGIN
	-- update the table for STD_LocationTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_LocationTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_LocationTypeHistory
after INSERT
ON SDSADM.STD_LOCATIONTYPEHISTORY
BEGIN
	-- update the table for STD_LocationTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_LocationTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_LocationTypeHistory
after UPDATE
ON SDSADM.STD_LOCATIONTYPEHISTORY
BEGIN
	-- update the table for STD_LocationTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_LocationTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_LOCATIONTYPEHISTORY FOR SDSADM.STD_LOCATIONTYPEHISTORY;


ALTER TABLE SDSADM.STD_LOCATIONTYPEHISTORY ADD (
  CONSTRAINT PK_STD_LOCATIONTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_LOCATIONTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_LOCATIONTYPEHISTORY ADD (
  CONSTRAINT FKSTD_LOCATIONTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_LOCATIONTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_LOCATIONTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_LOCATIONTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_LOCATIONTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_LOCATIONTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_LOCATIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_LOCATIONTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_LOCATIONTYPE ON SDSADM.STD_LOCATIONTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_LOCATIONTYPECODE ON SDSADM.STD_LOCATIONTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_LOCATIONTYPENAME ON SDSADM.STD_LOCATIONTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_LocationType
after DELETE
ON SDSADM.STD_LOCATIONTYPE
BEGIN
	-- update the table for STD_LocationType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_LocationType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_LocationType
after INSERT
ON SDSADM.STD_LOCATIONTYPE
BEGIN
	-- update the table for STD_LocationType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_LocationType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_LocationType
after UPDATE
ON SDSADM.STD_LOCATIONTYPE
BEGIN
	-- update the table for STD_LocationType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_LocationType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_LOCATIONTYPE FOR SDSADM.STD_LOCATIONTYPE;


ALTER TABLE SDSADM.STD_LOCATIONTYPE ADD (
  CONSTRAINT PK_STD_LOCATIONTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_LOCATIONTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_LOCATIONTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_LOCATIONTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_LOCATIONTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_LOCATIONTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_LOCATIONTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_LOCATIONTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_LOCATIONTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_LOCATIONTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IVMUNITHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IVMUNITHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IVMUNITHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IVMUNITHISTORY ON SDSADM.STD_IVMUNITHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IVMUnitHistory
after DELETE
ON SDSADM.STD_IVMUNITHISTORY
BEGIN
	-- update the table for STD_IVMUnitHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMUnitHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IVMUnitHistory
after INSERT
ON SDSADM.STD_IVMUNITHISTORY
BEGIN
	-- update the table for STD_IVMUnitHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMUnitHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IVMUnitHistory
after UPDATE
ON SDSADM.STD_IVMUNITHISTORY
BEGIN
	-- update the table for STD_IVMUnitHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMUnitHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IVMUNITHISTORY FOR SDSADM.STD_IVMUNITHISTORY;


ALTER TABLE SDSADM.STD_IVMUNITHISTORY ADD (
  CONSTRAINT PK_STD_IVMUNITHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IVMUNITHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_IVMUNITHISTORY ADD (
  CONSTRAINT FKSTD_IVMUNITHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_IVMUNIT (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IVMUNITHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_IVMUNITHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IVMUNITHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IVMUNITHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IVMUNITHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IVMUNITHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IVMUNITHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IVMUNITHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IVMUNITHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IVMUNIT
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IVMUNIT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IVMUNIT
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IVMUNIT ON SDSADM.STD_IVMUNIT
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IVMUNITCODE ON SDSADM.STD_IVMUNIT
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IVMUNITNAME ON SDSADM.STD_IVMUNIT
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IVMUnit
after DELETE
ON SDSADM.STD_IVMUNIT
BEGIN
	-- update the table for STD_IVMUnit operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMUnit';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IVMUnit
after INSERT
ON SDSADM.STD_IVMUNIT
BEGIN
	-- update the table for STD_IVMUnit operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMUnit';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IVMUnit
after UPDATE
ON SDSADM.STD_IVMUNIT
BEGIN
	-- update the table for STD_IVMUnit operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMUnit';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IVMUNIT FOR SDSADM.STD_IVMUNIT;


ALTER TABLE SDSADM.STD_IVMUNIT ADD (
  CONSTRAINT PK_STD_IVMUNIT
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IVMUNIT
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IVMUNITCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_IVMUNITCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IVMUNITNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_IVMUNITNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IVMUNIT TO ADR;

GRANT SELECT ON SDSADM.STD_IVMUNIT TO ADREXT;

GRANT SELECT ON SDSADM.STD_IVMUNIT TO EESRV;

GRANT SELECT ON SDSADM.STD_IVMUNIT TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IVMUNIT TO LOBR;

GRANT SELECT ON SDSADM.STD_IVMUNIT TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IVMUNIT TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IVMUNIT TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IVMUNIT TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IVMMIGRATETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IVMMIGRATETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IVMMIGRATETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IVMMIGRATETYPEHISTORY ON SDSADM.STD_IVMMIGRATETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IVMMigrateTypeHistory
after DELETE
ON SDSADM.STD_IVMMIGRATETYPEHISTORY
BEGIN
	-- update the table for STD_IVMMigrateTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMMigrateTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IVMMigrateTypeHistory
after INSERT
ON SDSADM.STD_IVMMIGRATETYPEHISTORY
BEGIN
	-- update the table for STD_IVMMigrateTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMMigrateTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IVMMigrateTypeHistory
after UPDATE
ON SDSADM.STD_IVMMIGRATETYPEHISTORY
BEGIN
	-- update the table for STD_IVMMigrateTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMMigrateTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IVMMIGRATETYPEHISTORY FOR SDSADM.STD_IVMMIGRATETYPEHISTORY;


ALTER TABLE SDSADM.STD_IVMMIGRATETYPEHISTORY ADD (
  CONSTRAINT PK_STD_IVMMIGRATETYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IVMMIGRATETYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_IVMMIGRATETYPEHISTORY ADD (
  CONSTRAINT FKSTD_IVMMIGRATETYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_IVMMIGRATETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IVMMIGRATETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IVMMIGRATETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IVMMIGRATETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IVMMIGRATETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IVMMIGRATETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IVMMIGRATETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IVMMIGRATETYPE ON SDSADM.STD_IVMMIGRATETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IVMMIGRATETYPECODE ON SDSADM.STD_IVMMIGRATETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IVMMigrateType
after DELETE
ON SDSADM.STD_IVMMIGRATETYPE
BEGIN
	-- update the table for STD_IVMMigrateType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMMigrateType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IVMMigrateType
after INSERT
ON SDSADM.STD_IVMMIGRATETYPE
BEGIN
	-- update the table for STD_IVMMigrateType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMMigrateType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IVMMigrateType
after UPDATE
ON SDSADM.STD_IVMMIGRATETYPE
BEGIN
	-- update the table for STD_IVMMigrateType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMMigrateType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IVMMIGRATETYPE FOR SDSADM.STD_IVMMIGRATETYPE;


ALTER TABLE SDSADM.STD_IVMMIGRATETYPE ADD (
  CONSTRAINT PK_STD_IVMMIGRATETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IVMMIGRATETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IVMMIGRATETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_IVMMIGRATETYPECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IVMMIGRATETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IVMMIGRATETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IVMMIGRATETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IVMMIGRATETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IVMDECISIONTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IVMDECISIONTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IVMDECISIONTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IVMDECISIONTYPEHISTORY ON SDSADM.STD_IVMDECISIONTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IVMDecisionTypeHstry
after DELETE
ON SDSADM.STD_IVMDECISIONTYPEHISTORY
BEGIN
	-- update the table for STD_IVMDecisionTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMDecisionTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IVMDecisionTypeHstry
after INSERT
ON SDSADM.STD_IVMDECISIONTYPEHISTORY
BEGIN
	-- update the table for STD_IVMDecisionTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMDecisionTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IVMDecisionTypeHstry
after UPDATE
ON SDSADM.STD_IVMDECISIONTYPEHISTORY
BEGIN
	-- update the table for STD_IVMDecisionTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMDecisionTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IVMDECISIONTYPEHISTORY FOR SDSADM.STD_IVMDECISIONTYPEHISTORY;


ALTER TABLE SDSADM.STD_IVMDECISIONTYPEHISTORY ADD (
  CONSTRAINT PK_STD_IVMDECISIONTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IVMDECISIONTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_IVMDECISIONTYPEHISTORY ADD (
  CONSTRAINT FKSTD_IVMDECISIONTYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_IVMDECISIONTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IVMDECISIONTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IVMDECISIONTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IVMDECISIONTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IVMDECISIONTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IVMDECISIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IVMDECISIONTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IVMDECISIONTYPE ON SDSADM.STD_IVMDECISIONTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IVMDECISIONTYPECODE ON SDSADM.STD_IVMDECISIONTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IVMDECISIONTYPENAME ON SDSADM.STD_IVMDECISIONTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IVMDecisionType
after DELETE
ON SDSADM.STD_IVMDECISIONTYPE
BEGIN
	-- update the table for STD_IVMDecisionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMDecisionType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IVMDecisionType
after INSERT
ON SDSADM.STD_IVMDECISIONTYPE
BEGIN
	-- update the table for STD_IVMDecisionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMDecisionType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IVMDecisionType
after UPDATE
ON SDSADM.STD_IVMDECISIONTYPE
BEGIN
	-- update the table for STD_IVMDecisionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMDecisionType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IVMDECISIONTYPE FOR SDSADM.STD_IVMDECISIONTYPE;


ALTER TABLE SDSADM.STD_IVMDECISIONTYPE ADD (
  CONSTRAINT PK_STD_IVMDECISIONTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IVMDECISIONTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IVMDECISIONTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_IVMDECISIONTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IVMDECISIONTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_IVMDECISIONTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IVMDECISIONTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IVMDECISIONTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IVMDECISIONTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IVMDECISIONTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IVMCASEPRIORCRITHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IVMCASEPRIORCRITHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IVMCASEPRIORCRITHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IVMCASEPRIORCRITHISTORY ON SDSADM.STD_IVMCASEPRIORCRITHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IVMCasePriorCritHstry
after DELETE
ON SDSADM.STD_IVMCASEPRIORCRITHISTORY
BEGIN
	-- update the table for STD_IVMCasePriorCritHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMCasePriorCritHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IVMCasePriorCritHstry
after INSERT
ON SDSADM.STD_IVMCASEPRIORCRITHISTORY
BEGIN
	-- update the table for STD_IVMCasePriorCritHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMCasePriorCritHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IVMCasePriorCritHstry
after UPDATE
ON SDSADM.STD_IVMCASEPRIORCRITHISTORY
BEGIN
	-- update the table for STD_IVMCasePriorCritHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMCasePriorCritHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IVMCASEPRIORCRITHISTORY FOR SDSADM.STD_IVMCASEPRIORCRITHISTORY;


ALTER TABLE SDSADM.STD_IVMCASEPRIORCRITHISTORY ADD (
  CONSTRAINT PK_STD_IVMCASEPRIORCRITHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IVMCASEPRIORCRITHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_IVMCASEPRIORCRITHISTORY ADD (
  CONSTRAINT FKSTD_IVMCASEPRIORCRTHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_IVMCASEPRIORCRIT (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IVMCASEPRIORCRITHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRITHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRITHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRITHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IVMCASEPRIORCRITHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRITHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IVMCASEPRIORCRITHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRITHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRITHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IVMCASEPRIORCRIT
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IVMCASEPRIORCRIT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IVMCASEPRIORCRIT
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IVMCASEPRIORCRIT ON SDSADM.STD_IVMCASEPRIORCRIT
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IVMCASEPRIORCRITCODE ON SDSADM.STD_IVMCASEPRIORCRIT
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IVMCASEPRIORCRITNAME ON SDSADM.STD_IVMCASEPRIORCRIT
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IVMCasePriorCrit
after DELETE
ON SDSADM.STD_IVMCASEPRIORCRIT
BEGIN
	-- update the table for STD_IVMCasePriorCrit operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMCasePriorCrit';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IVMCasePriorCrit
after INSERT
ON SDSADM.STD_IVMCASEPRIORCRIT
BEGIN
	-- update the table for STD_IVMCasePriorCrit operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMCasePriorCrit';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IVMCasePriorCrit
after UPDATE
ON SDSADM.STD_IVMCASEPRIORCRIT
BEGIN
	-- update the table for STD_IVMCasePriorCrit operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IVMCasePriorCrit';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IVMCASEPRIORCRIT FOR SDSADM.STD_IVMCASEPRIORCRIT;


ALTER TABLE SDSADM.STD_IVMCASEPRIORCRIT ADD (
  CONSTRAINT PK_STD_IVMCASEPRIORCRIT
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IVMCASEPRIORCRIT
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IVMCASEPRIORCRITCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_IVMCASEPRIORCRITCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IVMCASEPRIORCRITNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_IVMCASEPRIORCRITNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IVMCASEPRIORCRIT TO ADR;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRIT TO ADREXT;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRIT TO EESRV;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRIT TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IVMCASEPRIORCRIT TO LOBR;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRIT TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IVMCASEPRIORCRIT TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRIT TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IVMCASEPRIORCRIT TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSURANCETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSURANCETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSURANCETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSURANCETYPEHISTORY ON SDSADM.STD_INSURANCETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsuranceTypeHistory
after DELETE
ON SDSADM.STD_INSURANCETYPEHISTORY
BEGIN
	-- update the table for STD_InsuranceTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsuranceTypeHistory
after INSERT
ON SDSADM.STD_INSURANCETYPEHISTORY
BEGIN
	-- update the table for STD_InsuranceTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsuranceTypeHistory
after UPDATE
ON SDSADM.STD_INSURANCETYPEHISTORY
BEGIN
	-- update the table for STD_InsuranceTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSURANCETYPEHISTORY FOR SDSADM.STD_INSURANCETYPEHISTORY;


ALTER TABLE SDSADM.STD_INSURANCETYPEHISTORY ADD (
  CONSTRAINT PK_STD_INSURANCETYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSURANCETYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INSURANCETYPEHISTORY ADD (
  CONSTRAINT FKSTD_INSURANCETYPEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INSURANCETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSURANCETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INSURANCETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSURANCETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INSURANCETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSURANCETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INSURANCETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSURANCETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSURANCETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSURANCETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSURANCETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSURANCETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSURANCETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSURANCETYPE ON SDSADM.STD_INSURANCETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSURANCETYPECODE ON SDSADM.STD_INSURANCETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSURANCETYPENAME ON SDSADM.STD_INSURANCETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsuranceType
after DELETE
ON SDSADM.STD_INSURANCETYPE
BEGIN
	-- update the table for STD_InsuranceType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsuranceType
after INSERT
ON SDSADM.STD_INSURANCETYPE
BEGIN
	-- update the table for STD_InsuranceType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsuranceType
after UPDATE
ON SDSADM.STD_INSURANCETYPE
BEGIN
	-- update the table for STD_InsuranceType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSURANCETYPE FOR SDSADM.STD_INSURANCETYPE;


ALTER TABLE SDSADM.STD_INSURANCETYPE ADD (
  CONSTRAINT PK_STD_INSURANCETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSURANCETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSURANCETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_INSURANCETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSURANCETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_INSURANCETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSURANCETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_INSURANCETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSURANCETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_INSURANCETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSURANCETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_INSURANCETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSURANCETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSURANCETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSURANCETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSURANCEREPORTSOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSURANCEREPORTSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSURANCEREPORTSOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSRPRTSRC ON SDSADM.STD_INSURANCEREPORTSOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSRPRTSRCCODE ON SDSADM.STD_INSURANCEREPORTSOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSRPRTSRCNAME ON SDSADM.STD_INSURANCEREPORTSOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsRprtSrc
after DELETE
ON SDSADM.STD_INSURANCEREPORTSOURCE
BEGIN
	-- update the table for STD_InsuranceReportSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceReportSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsRprtSrc
after INSERT
ON SDSADM.STD_INSURANCEREPORTSOURCE
BEGIN
	-- update the table for STD_InsuranceReportSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceReportSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsRprtSrc
after UPDATE
ON SDSADM.STD_INSURANCEREPORTSOURCE
BEGIN
	-- update the table for STD_InsuranceReportSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceReportSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSURANCEREPORTSOURCE FOR SDSADM.STD_INSURANCEREPORTSOURCE;


ALTER TABLE SDSADM.STD_INSURANCEREPORTSOURCE ADD (
  CONSTRAINT PK_STD_INSRPRTSRC
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSRPRTSRC
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSRPRTSRCCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_INSRPRTSRCCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSRPRTSRCNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_INSRPRTSRCNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSURANCEREPORTSOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_INSURANCEREPORTSOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSURANCEREPORTSOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_INSURANCEREPORTSOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSURANCEREPORTSOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_INSURANCEREPORTSOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSURANCEREPORTSOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSURANCEREPORTSOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSURANCEREPORTSOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSURANCEPLANTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSURANCEPLANTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSURANCEPLANTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSPLANTYPE ON SDSADM.STD_INSURANCEPLANTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSPLANTYPECODE ON SDSADM.STD_INSURANCEPLANTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSPLANTYPENAME ON SDSADM.STD_INSURANCEPLANTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsPlanType
after DELETE
ON SDSADM.STD_INSURANCEPLANTYPE
BEGIN
	-- update the table for STD_InsurancePlanType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsurancePlanType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsPlanType
after INSERT
ON SDSADM.STD_INSURANCEPLANTYPE
BEGIN
	-- update the table for STD_InsurancePlanType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsurancePlanType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsPlanType
after UPDATE
ON SDSADM.STD_INSURANCEPLANTYPE
BEGIN
	-- update the table for STD_InsurancePlanType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsurancePlanType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSURANCEPLANTYPE FOR SDSADM.STD_INSURANCEPLANTYPE;


ALTER TABLE SDSADM.STD_INSURANCEPLANTYPE ADD (
  CONSTRAINT PK_STD_INSPLANTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSPLANTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSPLANTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_INSPLANTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSPLANTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_INSPLANTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSURANCEPLANTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_INSURANCEPLANTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSURANCEPLANTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_INSURANCEPLANTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSURANCEPLANTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_INSURANCEPLANTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSURANCEPLANTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSURANCEPLANTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSURANCEPLANTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSURANCEMAPPINGHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSURANCEMAPPINGHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSURANCEMAPPINGHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSURANCEMAPPINGHISTORY ON SDSADM.STD_INSURANCEMAPPINGHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsuranceMappingHstry
after DELETE
ON SDSADM.STD_INSURANCEMAPPINGHISTORY
BEGIN
	-- update the table for STD_InsuranceMappingHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceMappingHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsuranceMappingHstry
after INSERT
ON SDSADM.STD_INSURANCEMAPPINGHISTORY
BEGIN
	-- update the table for STD_InsuranceMappingHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceMappingHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsuranceMappingHstry
after UPDATE
ON SDSADM.STD_INSURANCEMAPPINGHISTORY
BEGIN
	-- update the table for STD_InsuranceMappingHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceMappingHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSURANCEMAPPINGHISTORY FOR SDSADM.STD_INSURANCEMAPPINGHISTORY;


ALTER TABLE SDSADM.STD_INSURANCEMAPPINGHISTORY ADD (
  CONSTRAINT PK_STD_INSURANCEMAPPINGHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSURANCEMAPPINGHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INSURANCEMAPPINGHISTORY ADD (
  CONSTRAINT FKSTD_INSURANCEMPPNGHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INSURANCEMAPPING (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSURANCEMAPPINGHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPINGHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPINGHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPINGHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSURANCEMAPPINGHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPINGHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSURANCEMAPPINGHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPINGHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPINGHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSURANCEMAPPING
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSURANCEMAPPING CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSURANCEMAPPING
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSURANCEMAPPING ON SDSADM.STD_INSURANCEMAPPING
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSURANCEMAPPINGCODE ON SDSADM.STD_INSURANCEMAPPING
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSURANCEMAPPINGNAME ON SDSADM.STD_INSURANCEMAPPING
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsuranceMapping
after DELETE
ON SDSADM.STD_INSURANCEMAPPING
BEGIN
	-- update the table for STD_InsuranceMapping operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceMapping';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsuranceMapping
after INSERT
ON SDSADM.STD_INSURANCEMAPPING
BEGIN
	-- update the table for STD_InsuranceMapping operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceMapping';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsuranceMapping
after UPDATE
ON SDSADM.STD_INSURANCEMAPPING
BEGIN
	-- update the table for STD_InsuranceMapping operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceMapping';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSURANCEMAPPING FOR SDSADM.STD_INSURANCEMAPPING;


ALTER TABLE SDSADM.STD_INSURANCEMAPPING ADD (
  CONSTRAINT PK_STD_INSURANCEMAPPING
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSURANCEMAPPING
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSURANCEMAPPINGCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_INSURANCEMAPPINGCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSURANCEMAPPINGNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_INSURANCEMAPPINGNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSURANCEMAPPING TO ADR;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPING TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPING TO EESRV;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPING TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSURANCEMAPPING TO LOBR;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPING TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSURANCEMAPPING TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPING TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSURANCEMAPPING TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSURANCEHOLDERTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSURANCEHOLDERTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSURANCEHOLDERTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSURANCEHOLDERTYPHSTRY ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsuranceHldrTypHstry
after DELETE
ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY
BEGIN
	-- update the table for STD_InsuranceHolderTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceHolderTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsuranceHldrTypHstry
after INSERT
ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY
BEGIN
	-- update the table for STD_InsuranceHolderTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceHolderTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsuranceHldrTypHstry
after UPDATE
ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY
BEGIN
	-- update the table for STD_InsuranceHolderTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceHolderTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSURANCEHOLDERTYPEHISTORY FOR SDSADM.STD_INSURANCEHOLDERTYPEHISTORY;


ALTER TABLE SDSADM.STD_INSURANCEHOLDERTYPEHISTORY ADD (
  CONSTRAINT PK_STD_INSURANCEHOLDERTYPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSURANCEHOLDERTYPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INSURANCEHOLDERTYPEHISTORY ADD (
  CONSTRAINT FKSTD_INSRNCHLDRTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INSURANCEHOLDERTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSURANCEHOLDERTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSURANCEHOLDERTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSURANCEHOLDERTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(1 BYTE)                 NOT NULL,
  NAME         VARCHAR2(40 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSURANCEHOLDERTYPE ON SDSADM.STD_INSURANCEHOLDERTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSURANCEHOLDERTYPECODE ON SDSADM.STD_INSURANCEHOLDERTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSURANCEHOLDERTYPENAME ON SDSADM.STD_INSURANCEHOLDERTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsuranceHolderType
after DELETE
ON SDSADM.STD_INSURANCEHOLDERTYPE
BEGIN
	-- update the table for STD_InsuranceHolderType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceHolderType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsuranceHolderType
after INSERT
ON SDSADM.STD_INSURANCEHOLDERTYPE
BEGIN
	-- update the table for STD_InsuranceHolderType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceHolderType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsuranceHolderType
after UPDATE
ON SDSADM.STD_INSURANCEHOLDERTYPE
BEGIN
	-- update the table for STD_InsuranceHolderType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsuranceHolderType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSURANCEHOLDERTYPE FOR SDSADM.STD_INSURANCEHOLDERTYPE;


ALTER TABLE SDSADM.STD_INSURANCEHOLDERTYPE ADD (
  CONSTRAINT PK_STD_INSURANCEHOLDERTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSURANCEHOLDERTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSURANCEHOLDERTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_INSURANCEHOLDERTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSURANCEHOLDERTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_INSURANCEHOLDERTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSURANCEHOLDERTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSURANCEHOLDERTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSURANCEHOLDERTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSURANCEHOLDERTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSTITUTIONCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSTITUTIONCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSTITUTIONCODE
(
  ID               NUMBER(20)                   NOT NULL,
  INSTITUTION_ID   NUMBER(20)                   NOT NULL,
  CODINGSYSTEM_ID  NUMBER(20)                   NOT NULL,
  CODEVALUE        VARCHAR2(20 BYTE)            NOT NULL,
  VERSION          INTEGER                      NOT NULL,
  CREATED          TIMESTAMP(6)                 NOT NULL,
  UPDATED          TIMESTAMP(6),
  CREATEDBY        VARCHAR2(32 BYTE)            NOT NULL,
  UPDATEDBY        VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSTCD ON SDSADM.STD_INSTITUTIONCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSTCDCODEVALUE ON SDSADM.STD_INSTITUTIONCODE
(CODEVALUE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InstCd
after DELETE
ON SDSADM.STD_INSTITUTIONCODE
BEGIN
	-- update the table for STD_InstitutionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InstitutionCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InstCd
after INSERT
ON SDSADM.STD_INSTITUTIONCODE
BEGIN
	-- update the table for STD_InstitutionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InstitutionCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InstCd
after UPDATE
ON SDSADM.STD_INSTITUTIONCODE
BEGIN
	-- update the table for STD_InstitutionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InstitutionCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSTITUTIONCODE FOR SDSADM.STD_INSTITUTIONCODE;


ALTER TABLE SDSADM.STD_INSTITUTIONCODE ADD (
  CONSTRAINT PK_STD_INSTCD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSTCD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSTCDCODEVALUE
  UNIQUE (CODEVALUE)
  USING INDEX SDSADM.UQSTD_INSTCDCODEVALUE
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INSTITUTIONCODE ADD (
  CONSTRAINT FKSTD_INSTCDCODINGSYSTEM 
  FOREIGN KEY (CODINGSYSTEM_ID) 
  REFERENCES SDSADM.STD_CODINGSYSTEM (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_INSTCDINSTITUTION 
  FOREIGN KEY (INSTITUTION_ID) 
  REFERENCES SDSADM.STD_INSTITUTION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSTITUTIONCODE TO ADR;

GRANT SELECT ON SDSADM.STD_INSTITUTIONCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSTITUTIONCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_INSTITUTIONCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSTITUTIONCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_INSTITUTIONCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSTITUTIONCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSTITUTIONCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSTITUTIONCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSTITUTION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSTITUTION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSTITUTION
(
  ID                   NUMBER(20)               NOT NULL,
  ACTIVATIONDATE       DATE,
  DEACTIVATIONDATE     DATE,
  NAME                 VARCHAR2(80 BYTE)        NOT NULL,
  STATIONNUMBER        VARCHAR2(7 BYTE),
  VISTANAME            VARCHAR2(30 BYTE)        NOT NULL,
  AGENCY_ID            NUMBER(20),
  STREETCOUNTRY_ID     NUMBER(20),
  STREETADDRESSLINE1   VARCHAR2(64 BYTE),
  STREETADDRESSLINE2   VARCHAR2(64 BYTE),
  STREETADDRESSLINE3   VARCHAR2(64 BYTE),
  STREETCITY           VARCHAR2(50 BYTE),
  STREETSTATE_ID       NUMBER(20),
  STREETCOUNTY_ID      NUMBER(20),
  STREETPOSTALCODE     VARCHAR2(10 BYTE),
  MAILINGCOUNTRY_ID    NUMBER(20),
  MAILINGADDRESSLINE1  VARCHAR2(64 BYTE),
  MAILINGADDRESSLINE2  VARCHAR2(64 BYTE),
  MAILINGADDRESSLINE3  VARCHAR2(64 BYTE),
  MAILINGCITY          VARCHAR2(50 BYTE),
  MAILINGSTATE_ID      NUMBER(20),
  MAILINGCOUNTY_ID     NUMBER(20),
  MAILINGPOSTALCODE    VARCHAR2(10 BYTE),
  FACILITYTYPE_ID      NUMBER(20)               NOT NULL,
  MFN_ZEG_RECIPIENT    CHAR(1 BYTE)             NOT NULL,
  PARENT_ID            NUMBER(20),
  REALIGNEDFROM_ID     NUMBER(20),
  REALIGNEDTO_ID       NUMBER(20),
  VISN_ID              NUMBER(20),
  VERSION              INTEGER                  NOT NULL,
  CREATED              TIMESTAMP(6)             NOT NULL,
  UPDATED              TIMESTAMP(6),
  CREATEDBY            VARCHAR2(32 BYTE)        NOT NULL,
  UPDATEDBY            VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          640K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INST ON SDSADM.STD_INSTITUTION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INSTSTATIONNUMBER ON SDSADM.STD_INSTITUTION
(STATIONNUMBER)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.DEL4_STD_INST
after DELETE
ON SDSADM.STD_INSTITUTION
BEGIN
	-- update the table for STD_Institution operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Institution';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.INS4_STD_INST
after INSERT
ON SDSADM.STD_INSTITUTION
BEGIN
	-- update the table for STD_Institution operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Institution';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.UPD4_STD_INST
after UPDATE
ON SDSADM.STD_INSTITUTION
BEGIN
	-- update the table for STD_Institution operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Institution';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSTITUTION FOR SDSADM.STD_INSTITUTION;


ALTER TABLE SDSADM.STD_INSTITUTION ADD (
  CONSTRAINT PK_STD_INST
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INST
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INSTSTATIONNUMBER
  UNIQUE (STATIONNUMBER)
  USING INDEX SDSADM.UQSTD_INSTSTATIONNUMBER
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INSTITUTION ADD (
  CONSTRAINT FKSTD_INSTPARENT 
  FOREIGN KEY (PARENT_ID) 
  REFERENCES SDSADM.STD_INSTITUTION (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_INSTREALIGNEDFROM 
  FOREIGN KEY (REALIGNEDFROM_ID) 
  REFERENCES SDSADM.STD_INSTITUTION (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_INSTREALIGNEDTO 
  FOREIGN KEY (REALIGNEDTO_ID) 
  REFERENCES SDSADM.STD_INSTITUTION (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_INSTVISN 
  FOREIGN KEY (VISN_ID) 
  REFERENCES SDSADM.STD_INSTITUTION (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES, SELECT ON SDSADM.STD_INSTITUTION TO ADR;

GRANT SELECT ON SDSADM.STD_INSTITUTION TO ADREXT;

GRANT REFERENCES, SELECT ON SDSADM.STD_INSTITUTION TO EESRV;

GRANT SELECT ON SDSADM.STD_INSTITUTION TO EEUSR WITH GRANT OPTION;

GRANT SELECT ON SDSADM.STD_INSTITUTION TO IAM_R;

GRANT SELECT ON SDSADM.STD_INSTITUTION TO IAM_RW;

GRANT REFERENCES ON SDSADM.STD_INSTITUTION TO LOBR;

GRANT REFERENCES, SELECT ON SDSADM.STD_INSTITUTION TO PATS;

GRANT REFERENCES, SELECT ON SDSADM.STD_INSTITUTION TO PATSRPTS;

GRANT REFERENCES, SELECT ON SDSADM.STD_INSTITUTION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSTITUTION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSTITUTION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSTITUTION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSRPRTSRCHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSRPRTSRCHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSRPRTSRCHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSRPRTSRCHISTORY ON SDSADM.STD_INSRPRTSRCHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsRprtSrcHistory
after DELETE
ON SDSADM.STD_INSRPRTSRCHISTORY
BEGIN
	-- update the table for STD_InsRprtSrcHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsRprtSrcHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsRprtSrcHistory
after INSERT
ON SDSADM.STD_INSRPRTSRCHISTORY
BEGIN
	-- update the table for STD_InsRprtSrcHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsRprtSrcHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsRprtSrcHistory
after UPDATE
ON SDSADM.STD_INSRPRTSRCHISTORY
BEGIN
	-- update the table for STD_InsRprtSrcHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsRprtSrcHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSRPRTSRCHISTORY FOR SDSADM.STD_INSRPRTSRCHISTORY;


ALTER TABLE SDSADM.STD_INSRPRTSRCHISTORY ADD (
  CONSTRAINT PK_STD_INSRPRTSRCHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSRPRTSRCHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INSRPRTSRCHISTORY ADD (
  CONSTRAINT FKSTD_INSRPRTSRCHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INSURANCEREPORTSOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSRPRTSRCHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INSRPRTSRCHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSRPRTSRCHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INSRPRTSRCHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSRPRTSRCHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INSRPRTSRCHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSRPRTSRCHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSRPRTSRCHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSRPRTSRCHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INSPLANTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INSPLANTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INSPLANTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INSPLANTYPEHISTORY ON SDSADM.STD_INSPLANTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_InsPlanTypeHistory
after DELETE
ON SDSADM.STD_INSPLANTYPEHISTORY
BEGIN
	-- update the table for STD_InsPlanTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsPlanTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_InsPlanTypeHistory
after INSERT
ON SDSADM.STD_INSPLANTYPEHISTORY
BEGIN
	-- update the table for STD_InsPlanTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsPlanTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_InsPlanTypeHistory
after UPDATE
ON SDSADM.STD_INSPLANTYPEHISTORY
BEGIN
	-- update the table for STD_InsPlanTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_InsPlanTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INSPLANTYPEHISTORY FOR SDSADM.STD_INSPLANTYPEHISTORY;


ALTER TABLE SDSADM.STD_INSPLANTYPEHISTORY ADD (
  CONSTRAINT PK_STD_INSPLANTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INSPLANTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INSPLANTYPEHISTORY ADD (
  CONSTRAINT FKSTD_INSPLANTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INSURANCEPLANTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INSPLANTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INSPLANTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INSPLANTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INSPLANTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INSPLANTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INSPLANTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INSPLANTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INSPLANTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INSPLANTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMEVERIFSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMEVERIFSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMEVERIFSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMEVERIFSTATUSHSTRY ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeVerifSttsHstry
after DELETE
ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY
BEGIN
	-- update the table for STD_IncomeVerifStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeVerifStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeVerifSttsHstry
after INSERT
ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY
BEGIN
	-- update the table for STD_IncomeVerifStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeVerifStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeVerifSttsHstry
after UPDATE
ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY
BEGIN
	-- update the table for STD_IncomeVerifStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeVerifStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMEVERIFSTATUSHISTORY FOR SDSADM.STD_INCOMEVERIFSTATUSHISTORY;


ALTER TABLE SDSADM.STD_INCOMEVERIFSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_INCOMEVERIFSTATUSHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMEVERIFSTATUSHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INCOMEVERIFSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_INCOMEVERIFSTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INCOMEVERIFSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMEVERIFSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMEVERIFSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMEVERIFSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(40 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMEVERIFSTATUS ON SDSADM.STD_INCOMEVERIFSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INCOMEVERIFSTATUSCODE ON SDSADM.STD_INCOMEVERIFSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INCOMEVERIFSTATUSNAME ON SDSADM.STD_INCOMEVERIFSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeVerifStatus
after DELETE
ON SDSADM.STD_INCOMEVERIFSTATUS
BEGIN
	-- update the table for STD_IncomeVerifStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeVerifStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeVerifStatus
after INSERT
ON SDSADM.STD_INCOMEVERIFSTATUS
BEGIN
	-- update the table for STD_IncomeVerifStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeVerifStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeVerifStatus
after UPDATE
ON SDSADM.STD_INCOMEVERIFSTATUS
BEGIN
	-- update the table for STD_IncomeVerifStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeVerifStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMEVERIFSTATUS FOR SDSADM.STD_INCOMEVERIFSTATUS;


ALTER TABLE SDSADM.STD_INCOMEVERIFSTATUS ADD (
  CONSTRAINT PK_STD_INCOMEVERIFSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMEVERIFSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INCOMEVERIFSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_INCOMEVERIFSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INCOMEVERIFSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_INCOMEVERIFSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMEVERIFSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMEVERIFSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMEVERIFSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMEVERIFSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMETYPEHISTORY ON SDSADM.STD_INCOMETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeTypeHistory
after DELETE
ON SDSADM.STD_INCOMETYPEHISTORY
BEGIN
	-- update the table for STD_IncomeTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeTypeHistory
after INSERT
ON SDSADM.STD_INCOMETYPEHISTORY
BEGIN
	-- update the table for STD_IncomeTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeTypeHistory
after UPDATE
ON SDSADM.STD_INCOMETYPEHISTORY
BEGIN
	-- update the table for STD_IncomeTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMETYPEHISTORY FOR SDSADM.STD_INCOMETYPEHISTORY;


ALTER TABLE SDSADM.STD_INCOMETYPEHISTORY ADD (
  CONSTRAINT PK_STD_INCOMETYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMETYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INCOMETYPEHISTORY ADD (
  CONSTRAINT FKSTD_INCOMETYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INCOMETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMETYPE ON SDSADM.STD_INCOMETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INCOMETYPECODE ON SDSADM.STD_INCOMETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INCOMETYPENAME ON SDSADM.STD_INCOMETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeType
after DELETE
ON SDSADM.STD_INCOMETYPE
BEGIN
	-- update the table for STD_IncomeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeType
after INSERT
ON SDSADM.STD_INCOMETYPE
BEGIN
	-- update the table for STD_IncomeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeType
after UPDATE
ON SDSADM.STD_INCOMETYPE
BEGIN
	-- update the table for STD_IncomeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMETYPE FOR SDSADM.STD_INCOMETYPE;


ALTER TABLE SDSADM.STD_INCOMETYPE ADD (
  CONSTRAINT PK_STD_INCOMETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INCOMETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_INCOMETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INCOMETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_INCOMETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMETHRESHOLDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMETHRESHOLDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMETHRESHOLDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMETHRESHOLDHISTORY ON SDSADM.STD_INCOMETHRESHOLDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeThresholdHstry
after DELETE
ON SDSADM.STD_INCOMETHRESHOLDHISTORY
BEGIN
	-- update the table for STD_IncomeThresholdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeThresholdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeThresholdHstry
after INSERT
ON SDSADM.STD_INCOMETHRESHOLDHISTORY
BEGIN
	-- update the table for STD_IncomeThresholdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeThresholdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeThresholdHstry
after UPDATE
ON SDSADM.STD_INCOMETHRESHOLDHISTORY
BEGIN
	-- update the table for STD_IncomeThresholdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeThresholdHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMETHRESHOLDHISTORY FOR SDSADM.STD_INCOMETHRESHOLDHISTORY;


ALTER TABLE SDSADM.STD_INCOMETHRESHOLDHISTORY ADD (
  CONSTRAINT PK_STD_INCOMETHRESHOLDHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMETHRESHOLDHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INCOMETHRESHOLDHISTORY ADD (
  CONSTRAINT FKSTD_INCOMETHRESHOLDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INCOMETHRESHOLD (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMETHRESHOLDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMETHRESHOLDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMETHRESHOLDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMETHRESHOLD
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMETHRESHOLD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMETHRESHOLD
(
  ID                            NUMBER(20)      NOT NULL,
  INCOME_THRESHOLD_YEAR         NUMBER(4)       NOT NULL,
  EXEMPT_AMOUNT                 NUMBER(10,2),
  MEDICAL_EXPENSE_DEDUCTIBLE    NUMBER(10,2),
  CHILD_INCOME_EXCLUSION        NUMBER(10,2),
  DEPENDENT                     NUMBER(10,2),
  ADD_DEPENDENT_THRESHOLD       NUMBER(10,2),
  PROPERTY_THRESHOLD            NUMBER(10,2),
  PENSION_THRESHOLD             NUMBER(10,2),
  PENSION_1_DEPENDENT           NUMBER(10,2),
  ADD_DEPENDENT_PENSION         NUMBER(10,2),
  NINETY_DAY_HOSPITAL_COPAY     NUMBER(10,2),
  ADD_90_DAY_HOSPITAL_COPAY     NUMBER(10,2),
  OUTPATIENT_BASIC_CARE_COPAY   NUMBER(10,2),
  OUTPATIENT_SPECIALTY_COPAY    NUMBER(10,2),
  THRESHOLD_EFFECTIVE_DATE      DATE,
  AID_AND_ATTENDANCE_THRESHOLD  NUMBER(10,2),
  OUTPATIENT_PREVENTIVE_COPAY   NUMBER(10,2),
  MEDICATION_COPAY              NUMBER(10,2),
  MEDICATION_COPAY_ANNUAL_CAP   NUMBER(10,2),
  LTC_INPATIENT_COPAY           NUMBER(10,2),
  LTC_OUTPATIENT_COPAY          NUMBER(10,2),
  LTC_DOMICILIARY_COPAY         NUMBER(10,2),
  INPATIENT_PER_DIEM            NUMBER(10,2),
  DESCRIPTION                   VARCHAR2(2000 BYTE),
  VERSION                       INTEGER         NOT NULL,
  CREATED                       TIMESTAMP(6)    NOT NULL,
  UPDATED                       TIMESTAMP(6),
  CREATEDBY                     VARCHAR2(32 BYTE) NOT NULL,
  UPDATEDBY                     VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMETHRESHOLD ON SDSADM.STD_INCOMETHRESHOLD
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeThreshold
after DELETE
ON SDSADM.STD_INCOMETHRESHOLD
BEGIN
	-- update the table for STD_IncomeThreshold operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeThreshold';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeThreshold
after INSERT
ON SDSADM.STD_INCOMETHRESHOLD
BEGIN
	-- update the table for STD_IncomeThreshold operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeThreshold';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeThreshold
after UPDATE
ON SDSADM.STD_INCOMETHRESHOLD
BEGIN
	-- update the table for STD_IncomeThreshold operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeThreshold';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMETHRESHOLD FOR SDSADM.STD_INCOMETHRESHOLD;


ALTER TABLE SDSADM.STD_INCOMETHRESHOLD ADD (
  CONSTRAINT PK_STD_INCOMETHRESHOLD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMETHRESHOLD
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMETHRESHOLD TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLD TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLD TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLD TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMETHRESHOLD TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLD TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMETHRESHOLD TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLD TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMETHRESHOLD TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMETESTTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMETESTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMETESTTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMETESTTYPEHISTORY ON SDSADM.STD_INCOMETESTTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeTestTypeHistory
after DELETE
ON SDSADM.STD_INCOMETESTTYPEHISTORY
BEGIN
	-- update the table for STD_IncomeTestTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeTestTypeHistory
after INSERT
ON SDSADM.STD_INCOMETESTTYPEHISTORY
BEGIN
	-- update the table for STD_IncomeTestTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeTestTypeHistory
after UPDATE
ON SDSADM.STD_INCOMETESTTYPEHISTORY
BEGIN
	-- update the table for STD_IncomeTestTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMETESTTYPEHISTORY FOR SDSADM.STD_INCOMETESTTYPEHISTORY;


ALTER TABLE SDSADM.STD_INCOMETESTTYPEHISTORY ADD (
  CONSTRAINT PK_STD_INCOMETESTTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMETESTTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INCOMETESTTYPEHISTORY ADD (
  CONSTRAINT FKSTD_INCOMETESTTYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INCOMETESTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMETESTTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMETESTTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMETESTTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMETESTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMETESTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMETESTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMETESTTYPE ON SDSADM.STD_INCOMETESTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INCOMETESTTYPECODE ON SDSADM.STD_INCOMETESTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INCOMETESTTYPENAME ON SDSADM.STD_INCOMETESTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeTestType
after DELETE
ON SDSADM.STD_INCOMETESTTYPE
BEGIN
	-- update the table for STD_IncomeTestType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeTestType
after INSERT
ON SDSADM.STD_INCOMETESTTYPE
BEGIN
	-- update the table for STD_IncomeTestType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeTestType
after UPDATE
ON SDSADM.STD_INCOMETESTTYPE
BEGIN
	-- update the table for STD_IncomeTestType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMETESTTYPE FOR SDSADM.STD_INCOMETESTTYPE;


ALTER TABLE SDSADM.STD_INCOMETESTTYPE ADD (
  CONSTRAINT PK_STD_INCOMETESTTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMETESTTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INCOMETESTTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_INCOMETESTTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INCOMETESTTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_INCOMETESTTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMETESTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMETESTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMETESTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMETESTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMETESTSOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMETESTSOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMETESTSOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMETESTSOURCEHISTORY ON SDSADM.STD_INCOMETESTSOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeTestSourceHstry
after DELETE
ON SDSADM.STD_INCOMETESTSOURCEHISTORY
BEGIN
	-- update the table for STD_IncomeTestSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeTestSourceHstry
after INSERT
ON SDSADM.STD_INCOMETESTSOURCEHISTORY
BEGIN
	-- update the table for STD_IncomeTestSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeTestSourceHstry
after UPDATE
ON SDSADM.STD_INCOMETESTSOURCEHISTORY
BEGIN
	-- update the table for STD_IncomeTestSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMETESTSOURCEHISTORY FOR SDSADM.STD_INCOMETESTSOURCEHISTORY;


ALTER TABLE SDSADM.STD_INCOMETESTSOURCEHISTORY ADD (
  CONSTRAINT PK_STD_INCOMETESTSOURCEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMETESTSOURCEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_INCOMETESTSOURCEHISTORY ADD (
  CONSTRAINT FKSTD_INCOMETESTSRCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_INCOMETESTSOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMETESTSOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMETESTSOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMETESTSOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_INCOMETESTSOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_INCOMETESTSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_INCOMETESTSOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_INCOMETESTSOURCE ON SDSADM.STD_INCOMETESTSOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_INCOMETESTSOURCECODE ON SDSADM.STD_INCOMETESTSOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IncomeTestSource
after DELETE
ON SDSADM.STD_INCOMETESTSOURCE
BEGIN
	-- update the table for STD_IncomeTestSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IncomeTestSource
after INSERT
ON SDSADM.STD_INCOMETESTSOURCE
BEGIN
	-- update the table for STD_IncomeTestSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IncomeTestSource
after UPDATE
ON SDSADM.STD_INCOMETESTSOURCE
BEGIN
	-- update the table for STD_IncomeTestSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IncomeTestSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_INCOMETESTSOURCE FOR SDSADM.STD_INCOMETESTSOURCE;


ALTER TABLE SDSADM.STD_INCOMETESTSOURCE ADD (
  CONSTRAINT PK_STD_INCOMETESTSOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_INCOMETESTSOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_INCOMETESTSOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_INCOMETESTSOURCECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_INCOMETESTSOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_INCOMETESTSOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_INCOMETESTSOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_INCOMETESTSOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDTASKSTATUSTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDTASKSTATUSTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDTASKSTATUSTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDTASKSTATUSTYPEHISTORY ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdTaskStatusTypeHstry
after DELETE
ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY
BEGIN
	-- update the table for STD_IdTaskStatusTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskStatusTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdTaskStatusTypeHstry
after INSERT
ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY
BEGIN
	-- update the table for STD_IdTaskStatusTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskStatusTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdTaskStatusTypeHstry
after UPDATE
ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY
BEGIN
	-- update the table for STD_IdTaskStatusTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskStatusTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDTASKSTATUSTYPEHISTORY FOR SDSADM.STD_IDTASKSTATUSTYPEHISTORY;


ALTER TABLE SDSADM.STD_IDTASKSTATUSTYPEHISTORY ADD (
  CONSTRAINT PK_STD_IDTASKSTATUSTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDTASKSTATUSTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_IDTASKSTATUSTYPEHISTORY ADD (
  CONSTRAINT FKSTD_IDTASKSTATUSTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_IDTASKSTATUSTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDTASKSTATUSTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDTASKSTATUSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDTASKSTATUSTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(20 BYTE)                NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDTASKSTATUSTYPE ON SDSADM.STD_IDTASKSTATUSTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDTASKSTATUSTYPECODE ON SDSADM.STD_IDTASKSTATUSTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDTASKSTATUSTYPENAME ON SDSADM.STD_IDTASKSTATUSTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdTaskStatusType
after DELETE
ON SDSADM.STD_IDTASKSTATUSTYPE
BEGIN
	-- update the table for STD_IdTaskStatusType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskStatusType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdTaskStatusType
after INSERT
ON SDSADM.STD_IDTASKSTATUSTYPE
BEGIN
	-- update the table for STD_IdTaskStatusType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskStatusType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdTaskStatusType
after UPDATE
ON SDSADM.STD_IDTASKSTATUSTYPE
BEGIN
	-- update the table for STD_IdTaskStatusType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskStatusType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDTASKSTATUSTYPE FOR SDSADM.STD_IDTASKSTATUSTYPE;


ALTER TABLE SDSADM.STD_IDTASKSTATUSTYPE ADD (
  CONSTRAINT PK_STD_IDTASKSTATUSTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDTASKSTATUSTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDTASKSTATUSTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_IDTASKSTATUSTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDTASKSTATUSTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_IDTASKSTATUSTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDTASKSTATUSTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDTASKSTATUSTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDTASKSTATUSTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDTASKSTATUSTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDTASKPROBCATEGORYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDTASKPROBCATEGORYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDTASKPROBCATEGORYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDTASKPROBCATEGORYHSTRY ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdTaskProbCtgryHstry
after DELETE
ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY
BEGIN
	-- update the table for STD_IdTaskProbCategoryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskProbCategoryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdTaskProbCtgryHstry
after INSERT
ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY
BEGIN
	-- update the table for STD_IdTaskProbCategoryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskProbCategoryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdTaskProbCtgryHstry
after UPDATE
ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY
BEGIN
	-- update the table for STD_IdTaskProbCategoryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskProbCategoryHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDTASKPROBCATEGORYHISTORY FOR SDSADM.STD_IDTASKPROBCATEGORYHISTORY;


ALTER TABLE SDSADM.STD_IDTASKPROBCATEGORYHISTORY ADD (
  CONSTRAINT PK_STD_IDTASKPROBCATEGORYHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDTASKPROBCATEGORYHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_IDTASKPROBCATEGORYHISTORY ADD (
  CONSTRAINT FKSTD_IDTASKPROBCTGRYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_IDTASKPROBCATEGORY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDTASKPROBCATEGORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDTASKPROBCATEGORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDTASKPROBCATEGORY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(20 BYTE)                NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDTASKPROBCATEGORY ON SDSADM.STD_IDTASKPROBCATEGORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDTASKPROBCATEGORYCODE ON SDSADM.STD_IDTASKPROBCATEGORY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDTASKPROBCATEGORYNAME ON SDSADM.STD_IDTASKPROBCATEGORY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdTaskProbCategory
after DELETE
ON SDSADM.STD_IDTASKPROBCATEGORY
BEGIN
	-- update the table for STD_IdTaskProbCategory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskProbCategory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdTaskProbCategory
after INSERT
ON SDSADM.STD_IDTASKPROBCATEGORY
BEGIN
	-- update the table for STD_IdTaskProbCategory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskProbCategory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdTaskProbCategory
after UPDATE
ON SDSADM.STD_IDTASKPROBCATEGORY
BEGIN
	-- update the table for STD_IdTaskProbCategory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdTaskProbCategory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDTASKPROBCATEGORY FOR SDSADM.STD_IDTASKPROBCATEGORY;


ALTER TABLE SDSADM.STD_IDTASKPROBCATEGORY ADD (
  CONSTRAINT PK_STD_IDTASKPROBCATEGORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDTASKPROBCATEGORY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDTASKPROBCATEGORYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_IDTASKPROBCATEGORYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDTASKPROBCATEGORYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_IDTASKPROBCATEGORYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDTASKPROBCATEGORY TO ADR;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDTASKPROBCATEGORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDTASKPROBCATEGORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDTASKPROBCATEGORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDEXCEPTYPEGROUPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDEXCEPTYPEGROUPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDEXCEPTYPEGROUPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDEXCEPTYPEGROUPHISTORY ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdExcepTypeGroupHstry
after DELETE
ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY
BEGIN
	-- update the table for STD_IdExcepTypeGroupHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdExcepTypeGroupHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdExcepTypeGroupHstry
after INSERT
ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY
BEGIN
	-- update the table for STD_IdExcepTypeGroupHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdExcepTypeGroupHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdExcepTypeGroupHstry
after UPDATE
ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY
BEGIN
	-- update the table for STD_IdExcepTypeGroupHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdExcepTypeGroupHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDEXCEPTYPEGROUPHISTORY FOR SDSADM.STD_IDEXCEPTYPEGROUPHISTORY;


ALTER TABLE SDSADM.STD_IDEXCEPTYPEGROUPHISTORY ADD (
  CONSTRAINT PK_STD_IDEXCEPTYPEGROUPHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDEXCEPTYPEGROUPHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_IDEXCEPTYPEGROUPHISTORY ADD (
  CONSTRAINT FKSTD_IDEXCEPTYPEGRPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_IDEXCEPTYPEGROUP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDEXCEPTYPEGROUP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDEXCEPTYPEGROUP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDEXCEPTYPEGROUP
(
  ID               NUMBER(20)                   NOT NULL,
  NAME             VARCHAR2(50 BYTE)            NOT NULL,
  CREATE_TASK_IND  NUMBER(10)                   NOT NULL,
  DESCRIPTION      VARCHAR2(60 BYTE),
  VERSION          INTEGER                      NOT NULL,
  CREATED          TIMESTAMP(6)                 NOT NULL,
  UPDATED          TIMESTAMP(6),
  CREATEDBY        VARCHAR2(32 BYTE)            NOT NULL,
  UPDATEDBY        VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDEXCEPTYPEGROUP ON SDSADM.STD_IDEXCEPTYPEGROUP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDEXCEPTYPEGROUPNAME ON SDSADM.STD_IDEXCEPTYPEGROUP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDEXCEPTYPEGRPCRT_TSK_ND ON SDSADM.STD_IDEXCEPTYPEGROUP
(CREATE_TASK_IND)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdExcepTypeGroup
after DELETE
ON SDSADM.STD_IDEXCEPTYPEGROUP
BEGIN
	-- update the table for STD_IdExcepTypeGroup operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdExcepTypeGroup';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdExcepTypeGroup
after INSERT
ON SDSADM.STD_IDEXCEPTYPEGROUP
BEGIN
	-- update the table for STD_IdExcepTypeGroup operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdExcepTypeGroup';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdExcepTypeGroup
after UPDATE
ON SDSADM.STD_IDEXCEPTYPEGROUP
BEGIN
	-- update the table for STD_IdExcepTypeGroup operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdExcepTypeGroup';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDEXCEPTYPEGROUP FOR SDSADM.STD_IDEXCEPTYPEGROUP;


ALTER TABLE SDSADM.STD_IDEXCEPTYPEGROUP ADD (
  CONSTRAINT PK_STD_IDEXCEPTYPEGROUP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDEXCEPTYPEGROUP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDEXCEPTYPEGROUPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_IDEXCEPTYPEGROUPNAME
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDEXCEPTYPEGRPCRT_TSK_ND
  UNIQUE (CREATE_TASK_IND)
  USING INDEX SDSADM.UQSTD_IDEXCEPTYPEGRPCRT_TSK_ND
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDEXCEPTYPEGROUP TO ADR;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUP TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUP TO EESRV;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDEXCEPTYPEGROUP TO LOBR;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDEXCEPTYPEGROUP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDEXCEPTYPEGROUP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDEVENTTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDEVENTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDEVENTTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDEVENTTYPEHISTORY ON SDSADM.STD_IDEVENTTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdEventTypeHistory
after DELETE
ON SDSADM.STD_IDEVENTTYPEHISTORY
BEGIN
	-- update the table for STD_IdEventTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdEventTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdEventTypeHistory
after INSERT
ON SDSADM.STD_IDEVENTTYPEHISTORY
BEGIN
	-- update the table for STD_IdEventTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdEventTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdEventTypeHistory
after UPDATE
ON SDSADM.STD_IDEVENTTYPEHISTORY
BEGIN
	-- update the table for STD_IdEventTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdEventTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDEVENTTYPEHISTORY FOR SDSADM.STD_IDEVENTTYPEHISTORY;


ALTER TABLE SDSADM.STD_IDEVENTTYPEHISTORY ADD (
  CONSTRAINT PK_STD_IDEVENTTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDEVENTTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_IDEVENTTYPEHISTORY ADD (
  CONSTRAINT FKSTD_IDEVENTTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_IDEVENTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDEVENTTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDEVENTTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDEVENTTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDEVENTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDEVENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDEVENTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(20 BYTE)                NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDEVENTTYPE ON SDSADM.STD_IDEVENTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDEVENTTYPECODE ON SDSADM.STD_IDEVENTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDEVENTTYPENAME ON SDSADM.STD_IDEVENTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdEventType
after DELETE
ON SDSADM.STD_IDEVENTTYPE
BEGIN
	-- update the table for STD_IdEventType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdEventType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdEventType
after INSERT
ON SDSADM.STD_IDEVENTTYPE
BEGIN
	-- update the table for STD_IdEventType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdEventType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdEventType
after UPDATE
ON SDSADM.STD_IDEVENTTYPE
BEGIN
	-- update the table for STD_IdEventType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdEventType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDEVENTTYPE FOR SDSADM.STD_IDEVENTTYPE;


ALTER TABLE SDSADM.STD_IDEVENTTYPE ADD (
  CONSTRAINT PK_STD_IDEVENTTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDEVENTTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDEVENTTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_IDEVENTTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDEVENTTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_IDEVENTTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDEVENTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDEVENTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDEVENTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDEVENTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDENTIFIERTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDENTIFIERTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDENTIFIERTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDENTIFIERTYPEHISTORY ON SDSADM.STD_IDENTIFIERTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdentifierTypeHistory
after DELETE
ON SDSADM.STD_IDENTIFIERTYPEHISTORY
BEGIN
	-- update the table for STD_IdentifierTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdentifierTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdentifierTypeHistory
after INSERT
ON SDSADM.STD_IDENTIFIERTYPEHISTORY
BEGIN
	-- update the table for STD_IdentifierTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdentifierTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdentifierTypeHistory
after UPDATE
ON SDSADM.STD_IDENTIFIERTYPEHISTORY
BEGIN
	-- update the table for STD_IdentifierTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdentifierTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDENTIFIERTYPEHISTORY FOR SDSADM.STD_IDENTIFIERTYPEHISTORY;


ALTER TABLE SDSADM.STD_IDENTIFIERTYPEHISTORY ADD (
  CONSTRAINT PK_STD_IDENTIFIERTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDENTIFIERTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_IDENTIFIERTYPEHISTORY ADD (
  CONSTRAINT FKSTD_IDENTIFIERTYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_IDENTIFIERTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDENTIFIERTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDENTIFIERTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDENTIFIERTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_IDENTIFIERTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_IDENTIFIERTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_IDENTIFIERTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_IDENTIFIERTYPE ON SDSADM.STD_IDENTIFIERTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDENTIFIERTYPECODE ON SDSADM.STD_IDENTIFIERTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_IDENTIFIERTYPENAME ON SDSADM.STD_IDENTIFIERTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_IdentifierType
after DELETE
ON SDSADM.STD_IDENTIFIERTYPE
BEGIN
	-- update the table for STD_IdentifierType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdentifierType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_IdentifierType
after INSERT
ON SDSADM.STD_IDENTIFIERTYPE
BEGIN
	-- update the table for STD_IdentifierType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdentifierType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_IdentifierType
after UPDATE
ON SDSADM.STD_IDENTIFIERTYPE
BEGIN
	-- update the table for STD_IdentifierType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_IdentifierType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_IDENTIFIERTYPE FOR SDSADM.STD_IDENTIFIERTYPE;


ALTER TABLE SDSADM.STD_IDENTIFIERTYPE ADD (
  CONSTRAINT PK_STD_IDENTIFIERTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_IDENTIFIERTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDENTIFIERTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_IDENTIFIERTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_IDENTIFIERTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_IDENTIFIERTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_IDENTIFIERTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_IDENTIFIERTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_IDENTIFIERTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_IDENTIFIERTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7WHATSUBJECTFLTRHSTRY ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7WhatSbjctFltrHstry
after DELETE
ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY
BEGIN
	-- update the table for STD_HL7WhatSubjectFltrHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7WhatSubjectFltrHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7WhatSbjctFltrHstry
after INSERT
ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY
BEGIN
	-- update the table for STD_HL7WhatSubjectFltrHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7WhatSubjectFltrHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7WhatSbjctFltrHstry
after UPDATE
ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY
BEGIN
	-- update the table for STD_HL7WhatSubjectFltrHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7WhatSubjectFltrHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7WHATSUBJECTFLTRHISTORY FOR SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY;


ALTER TABLE SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY ADD (
  CONSTRAINT PK_STD_HL7WHATSUBJECTFLTRHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7WHATSUBJECTFLTRHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY ADD (
  CONSTRAINT FKSTD_HL7WHTSBJCTFLTRHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7WHATSUBJECTFLTR (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7WHATSUBJECTFLTR
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7WHATSUBJECTFLTR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7WHATSUBJECTFLTR
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(3 BYTE)                     NOT NULL,
  NAME         VARCHAR2(90 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7WHATSUBJECTFLTR ON SDSADM.STD_HL7WHATSUBJECTFLTR
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7WHATSUBJECTFLTRCODE ON SDSADM.STD_HL7WHATSUBJECTFLTR
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7WHATSUBJECTFLTRNAME ON SDSADM.STD_HL7WHATSUBJECTFLTR
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7WhatSubjectFltr
after DELETE
ON SDSADM.STD_HL7WHATSUBJECTFLTR
BEGIN
	-- update the table for STD_HL7WhatSubjectFltr operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7WhatSubjectFltr';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7WhatSubjectFltr
after INSERT
ON SDSADM.STD_HL7WHATSUBJECTFLTR
BEGIN
	-- update the table for STD_HL7WhatSubjectFltr operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7WhatSubjectFltr';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7WhatSubjectFltr
after UPDATE
ON SDSADM.STD_HL7WHATSUBJECTFLTR
BEGIN
	-- update the table for STD_HL7WhatSubjectFltr operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7WhatSubjectFltr';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7WHATSUBJECTFLTR FOR SDSADM.STD_HL7WHATSUBJECTFLTR;


ALTER TABLE SDSADM.STD_HL7WHATSUBJECTFLTR ADD (
  CONSTRAINT PK_STD_HL7WHATSUBJECTFLTR
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7WHATSUBJECTFLTR
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7WHATSUBJECTFLTRCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7WHATSUBJECTFLTRCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7WHATSUBJECTFLTRNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7WHATSUBJECTFLTRNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7WHATSUBJECTFLTR TO ADR;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTR TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTR TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTR TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7WHATSUBJECTFLTR TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTR TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7WHATSUBJECTFLTR TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTR TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7WHATSUBJECTFLTR TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7VERSIONIDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7VERSIONIDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7VERSIONIDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7VERSIONIDHISTORY ON SDSADM.STD_HL7VERSIONIDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7VersionIDHistory
after DELETE
ON SDSADM.STD_HL7VERSIONIDHISTORY
BEGIN
	-- update the table for STD_HL7VersionIDHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7VersionIDHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7VersionIDHistory
after INSERT
ON SDSADM.STD_HL7VERSIONIDHISTORY
BEGIN
	-- update the table for STD_HL7VersionIDHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7VersionIDHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7VersionIDHistory
after UPDATE
ON SDSADM.STD_HL7VERSIONIDHISTORY
BEGIN
	-- update the table for STD_HL7VersionIDHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7VersionIDHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7VERSIONIDHISTORY FOR SDSADM.STD_HL7VERSIONIDHISTORY;


ALTER TABLE SDSADM.STD_HL7VERSIONIDHISTORY ADD (
  CONSTRAINT PK_STD_HL7VERSIONIDHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7VERSIONIDHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7VERSIONIDHISTORY ADD (
  CONSTRAINT FKSTD_HL7VERSIONIDHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7VERSIONID (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7VERSIONIDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7VERSIONIDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7VERSIONIDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7VERSIONIDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7VERSIONIDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7VERSIONIDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7VERSIONIDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7VERSIONIDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7VERSIONIDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7VERSIONID
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7VERSIONID CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7VERSIONID
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(7 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7VERSIONID ON SDSADM.STD_HL7VERSIONID
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7VERSIONIDCODE ON SDSADM.STD_HL7VERSIONID
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7VERSIONIDNAME ON SDSADM.STD_HL7VERSIONID
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7VersionID
after DELETE
ON SDSADM.STD_HL7VERSIONID
BEGIN
	-- update the table for STD_HL7VersionID operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7VersionID';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7VersionID
after INSERT
ON SDSADM.STD_HL7VERSIONID
BEGIN
	-- update the table for STD_HL7VersionID operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7VersionID';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7VersionID
after UPDATE
ON SDSADM.STD_HL7VERSIONID
BEGIN
	-- update the table for STD_HL7VersionID operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7VersionID';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7VERSIONID FOR SDSADM.STD_HL7VERSIONID;


ALTER TABLE SDSADM.STD_HL7VERSIONID ADD (
  CONSTRAINT PK_STD_HL7VERSIONID
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7VERSIONID
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7VERSIONIDCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7VERSIONIDCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7VERSIONIDNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7VERSIONIDNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7VERSIONID TO ADR;

GRANT SELECT ON SDSADM.STD_HL7VERSIONID TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7VERSIONID TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7VERSIONID TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7VERSIONID TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7VERSIONID TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7VERSIONID TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7VERSIONID TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7VERSIONID TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7VALUETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7VALUETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7VALUETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7VALUETYPEHISTORY ON SDSADM.STD_HL7VALUETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ValueTypeHistory
after DELETE
ON SDSADM.STD_HL7VALUETYPEHISTORY
BEGIN
	-- update the table for STD_HL7ValueTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ValueTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ValueTypeHistory
after INSERT
ON SDSADM.STD_HL7VALUETYPEHISTORY
BEGIN
	-- update the table for STD_HL7ValueTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ValueTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ValueTypeHistory
after UPDATE
ON SDSADM.STD_HL7VALUETYPEHISTORY
BEGIN
	-- update the table for STD_HL7ValueTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ValueTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7VALUETYPEHISTORY FOR SDSADM.STD_HL7VALUETYPEHISTORY;


ALTER TABLE SDSADM.STD_HL7VALUETYPEHISTORY ADD (
  CONSTRAINT PK_STD_HL7VALUETYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7VALUETYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7VALUETYPEHISTORY ADD (
  CONSTRAINT FKSTD_HL7VALUETYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7VALUETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7VALUETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7VALUETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7VALUETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7VALUETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7VALUETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7VALUETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(60 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7VALUETYPE ON SDSADM.STD_HL7VALUETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7VALUETYPECODE ON SDSADM.STD_HL7VALUETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7VALUETYPENAME ON SDSADM.STD_HL7VALUETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ValueType
after DELETE
ON SDSADM.STD_HL7VALUETYPE
BEGIN
	-- update the table for STD_HL7ValueType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ValueType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ValueType
after INSERT
ON SDSADM.STD_HL7VALUETYPE
BEGIN
	-- update the table for STD_HL7ValueType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ValueType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ValueType
after UPDATE
ON SDSADM.STD_HL7VALUETYPE
BEGIN
	-- update the table for STD_HL7ValueType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ValueType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7VALUETYPE FOR SDSADM.STD_HL7VALUETYPE;


ALTER TABLE SDSADM.STD_HL7VALUETYPE ADD (
  CONSTRAINT PK_STD_HL7VALUETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7VALUETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7VALUETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7VALUETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7VALUETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7VALUETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7VALUETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7VALUETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7VALUETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7VALUETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7SRCOFCOMMENTHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7SRCOFCOMMENTHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7SRCOFCOMMENTHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7SRCOFCOMMENTHISTORY ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7SrcOfCommentHstry
after DELETE
ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY
BEGIN
	-- update the table for STD_HL7SrcOfCommentHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7SrcOfCommentHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7SrcOfCommentHstry
after INSERT
ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY
BEGIN
	-- update the table for STD_HL7SrcOfCommentHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7SrcOfCommentHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7SrcOfCommentHstry
after UPDATE
ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY
BEGIN
	-- update the table for STD_HL7SrcOfCommentHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7SrcOfCommentHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7SRCOFCOMMENTHISTORY FOR SDSADM.STD_HL7SRCOFCOMMENTHISTORY;


ALTER TABLE SDSADM.STD_HL7SRCOFCOMMENTHISTORY ADD (
  CONSTRAINT PK_STD_HL7SRCOFCOMMENTHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7SRCOFCOMMENTHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7SRCOFCOMMENTHISTORY ADD (
  CONSTRAINT FKSTD_HL7SRCOFCOMMENTHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7SRCOFCOMMENT (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENTHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7SRCOFCOMMENT
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7SRCOFCOMMENT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7SRCOFCOMMENT
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(1 BYTE)                 NOT NULL,
  NAME         VARCHAR2(60 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7SRCOFCOMMENT ON SDSADM.STD_HL7SRCOFCOMMENT
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7SRCOFCOMMENTCODE ON SDSADM.STD_HL7SRCOFCOMMENT
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7SRCOFCOMMENTNAME ON SDSADM.STD_HL7SRCOFCOMMENT
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7SrcOfComment
after DELETE
ON SDSADM.STD_HL7SRCOFCOMMENT
BEGIN
	-- update the table for STD_HL7SrcOfComment operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7SrcOfComment';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7SrcOfComment
after INSERT
ON SDSADM.STD_HL7SRCOFCOMMENT
BEGIN
	-- update the table for STD_HL7SrcOfComment operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7SrcOfComment';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7SrcOfComment
after UPDATE
ON SDSADM.STD_HL7SRCOFCOMMENT
BEGIN
	-- update the table for STD_HL7SrcOfComment operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7SrcOfComment';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7SRCOFCOMMENT FOR SDSADM.STD_HL7SRCOFCOMMENT;


ALTER TABLE SDSADM.STD_HL7SRCOFCOMMENT ADD (
  CONSTRAINT PK_STD_HL7SRCOFCOMMENT
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7SRCOFCOMMENT
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7SRCOFCOMMENTCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7SRCOFCOMMENTCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7SRCOFCOMMENTNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7SRCOFCOMMENTNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7SRCOFCOMMENT TO ADR;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENT TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENT TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENT TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7SRCOFCOMMENT TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENT TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7SRCOFCOMMENT TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENT TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7SRCOFCOMMENT TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7RESPMODALITYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7RESPMODALITYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7RESPMODALITYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7RESPMODALITYHISTORY ON SDSADM.STD_HL7RESPMODALITYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7RespModalityHstry
after DELETE
ON SDSADM.STD_HL7RESPMODALITYHISTORY
BEGIN
	-- update the table for STD_HL7RespModalityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespModalityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7RespModalityHstry
after INSERT
ON SDSADM.STD_HL7RESPMODALITYHISTORY
BEGIN
	-- update the table for STD_HL7RespModalityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespModalityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7RespModalityHstry
after UPDATE
ON SDSADM.STD_HL7RESPMODALITYHISTORY
BEGIN
	-- update the table for STD_HL7RespModalityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespModalityHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7RESPMODALITYHISTORY FOR SDSADM.STD_HL7RESPMODALITYHISTORY;


ALTER TABLE SDSADM.STD_HL7RESPMODALITYHISTORY ADD (
  CONSTRAINT PK_STD_HL7RESPMODALITYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7RESPMODALITYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7RESPMODALITYHISTORY ADD (
  CONSTRAINT FKSTD_HL7RESPMODALITYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7RESPMODALITY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7RESPMODALITYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7RESPMODALITYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7RESPMODALITYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7RESPMODALITY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7RESPMODALITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7RESPMODALITY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7RESPMODALITY ON SDSADM.STD_HL7RESPMODALITY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7RESPMODALITYCODE ON SDSADM.STD_HL7RESPMODALITY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7RESPMODALITYNAME ON SDSADM.STD_HL7RESPMODALITY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7RespModality
after DELETE
ON SDSADM.STD_HL7RESPMODALITY
BEGIN
	-- update the table for STD_HL7RespModality operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespModality';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7RespModality
after INSERT
ON SDSADM.STD_HL7RESPMODALITY
BEGIN
	-- update the table for STD_HL7RespModality operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespModality';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7RespModality
after UPDATE
ON SDSADM.STD_HL7RESPMODALITY
BEGIN
	-- update the table for STD_HL7RespModality operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespModality';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7RESPMODALITY FOR SDSADM.STD_HL7RESPMODALITY;


ALTER TABLE SDSADM.STD_HL7RESPMODALITY ADD (
  CONSTRAINT PK_STD_HL7RESPMODALITY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7RESPMODALITY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7RESPMODALITYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7RESPMODALITYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7RESPMODALITYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7RESPMODALITYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7RESPMODALITY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7RESPMODALITY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7RESPMODALITY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7RESPMODALITY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7RESPLEVCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7RESPLEVCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7RESPLEVCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7RESPLEVCODEHISTORY ON SDSADM.STD_HL7RESPLEVCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7RespLevCodeHistory
after DELETE
ON SDSADM.STD_HL7RESPLEVCODEHISTORY
BEGIN
	-- update the table for STD_HL7RespLevCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespLevCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7RespLevCodeHistory
after INSERT
ON SDSADM.STD_HL7RESPLEVCODEHISTORY
BEGIN
	-- update the table for STD_HL7RespLevCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespLevCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7RespLevCodeHistory
after UPDATE
ON SDSADM.STD_HL7RESPLEVCODEHISTORY
BEGIN
	-- update the table for STD_HL7RespLevCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespLevCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7RESPLEVCODEHISTORY FOR SDSADM.STD_HL7RESPLEVCODEHISTORY;


ALTER TABLE SDSADM.STD_HL7RESPLEVCODEHISTORY ADD (
  CONSTRAINT PK_STD_HL7RESPLEVCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7RESPLEVCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7RESPLEVCODEHISTORY ADD (
  CONSTRAINT FKSTD_HL7RESPLEVCODEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7RESPLEVCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7RESPLEVCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7RESPLEVCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7RESPLEVCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7RESPLEVCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7RESPLEVCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7RESPLEVCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7RESPLEVCODE ON SDSADM.STD_HL7RESPLEVCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7RESPLEVCODECODE ON SDSADM.STD_HL7RESPLEVCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7RESPLEVCODENAME ON SDSADM.STD_HL7RESPLEVCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7RespLevCode
after DELETE
ON SDSADM.STD_HL7RESPLEVCODE
BEGIN
	-- update the table for STD_HL7RespLevCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespLevCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7RespLevCode
after INSERT
ON SDSADM.STD_HL7RESPLEVCODE
BEGIN
	-- update the table for STD_HL7RespLevCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespLevCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7RespLevCode
after UPDATE
ON SDSADM.STD_HL7RESPLEVCODE
BEGIN
	-- update the table for STD_HL7RespLevCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RespLevCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7RESPLEVCODE FOR SDSADM.STD_HL7RESPLEVCODE;


ALTER TABLE SDSADM.STD_HL7RESPLEVCODE ADD (
  CONSTRAINT PK_STD_HL7RESPLEVCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7RESPLEVCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7RESPLEVCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7RESPLEVCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7RESPLEVCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7RESPLEVCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7RESPLEVCODE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7RESPLEVCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7RESPLEVCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7RESPLEVCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7RECLEVEVCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7RECLEVEVCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7RECLEVEVCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7RECLEVEVCODEHISTORY ON SDSADM.STD_HL7RECLEVEVCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7RecLevEvCodeHstry
after DELETE
ON SDSADM.STD_HL7RECLEVEVCODEHISTORY
BEGIN
	-- update the table for STD_HL7RecLevEvCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevEvCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7RecLevEvCodeHstry
after INSERT
ON SDSADM.STD_HL7RECLEVEVCODEHISTORY
BEGIN
	-- update the table for STD_HL7RecLevEvCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevEvCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7RecLevEvCodeHstry
after UPDATE
ON SDSADM.STD_HL7RECLEVEVCODEHISTORY
BEGIN
	-- update the table for STD_HL7RecLevEvCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevEvCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7RECLEVEVCODEHISTORY FOR SDSADM.STD_HL7RECLEVEVCODEHISTORY;


ALTER TABLE SDSADM.STD_HL7RECLEVEVCODEHISTORY ADD (
  CONSTRAINT PK_STD_HL7RECLEVEVCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7RECLEVEVCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7RECLEVEVCODEHISTORY ADD (
  CONSTRAINT FKSTD_HL7RECLEVEVCODEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7RECLEVEVCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7RECLEVEVCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7RECLEVEVCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7RECLEVEVCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7RECLEVEVCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7RECLEVEVCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7RECLEVEVCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(3 BYTE)                     NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7RECLEVEVCODE ON SDSADM.STD_HL7RECLEVEVCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7RECLEVEVCODECODE ON SDSADM.STD_HL7RECLEVEVCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7RECLEVEVCODENAME ON SDSADM.STD_HL7RECLEVEVCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7RecLevEvCode
after DELETE
ON SDSADM.STD_HL7RECLEVEVCODE
BEGIN
	-- update the table for STD_HL7RecLevEvCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevEvCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7RecLevEvCode
after INSERT
ON SDSADM.STD_HL7RECLEVEVCODE
BEGIN
	-- update the table for STD_HL7RecLevEvCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevEvCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7RecLevEvCode
after UPDATE
ON SDSADM.STD_HL7RECLEVEVCODE
BEGIN
	-- update the table for STD_HL7RecLevEvCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevEvCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7RECLEVEVCODE FOR SDSADM.STD_HL7RECLEVEVCODE;


ALTER TABLE SDSADM.STD_HL7RECLEVEVCODE ADD (
  CONSTRAINT PK_STD_HL7RECLEVEVCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7RECLEVEVCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7RECLEVEVCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7RECLEVEVCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7RECLEVEVCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7RECLEVEVCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7RECLEVEVCODE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7RECLEVEVCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7RECLEVEVCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7RECLEVEVCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7RECLEVERRRETHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7RECLEVERRRETHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7RECLEVERRRETHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7RECLEVERRRETHISTORY ON SDSADM.STD_HL7RECLEVERRRETHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7RecLevErrRetHstry
after DELETE
ON SDSADM.STD_HL7RECLEVERRRETHISTORY
BEGIN
	-- update the table for STD_HL7RecLevErrRetHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevErrRetHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7RecLevErrRetHstry
after INSERT
ON SDSADM.STD_HL7RECLEVERRRETHISTORY
BEGIN
	-- update the table for STD_HL7RecLevErrRetHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevErrRetHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7RecLevErrRetHstry
after UPDATE
ON SDSADM.STD_HL7RECLEVERRRETHISTORY
BEGIN
	-- update the table for STD_HL7RecLevErrRetHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevErrRetHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7RECLEVERRRETHISTORY FOR SDSADM.STD_HL7RECLEVERRRETHISTORY;


ALTER TABLE SDSADM.STD_HL7RECLEVERRRETHISTORY ADD (
  CONSTRAINT PK_STD_HL7RECLEVERRRETHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7RECLEVERRRETHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7RECLEVERRRETHISTORY ADD (
  CONSTRAINT FKSTD_HL7RECLEVERRRETHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7RECLEVERRRET (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7RECLEVERRRETHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRETHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRETHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRETHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7RECLEVERRRETHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRETHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7RECLEVERRRETHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRETHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRETHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7RECLEVERRRET
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7RECLEVERRRET CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7RECLEVERRRET
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(70 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7RECLEVERRRET ON SDSADM.STD_HL7RECLEVERRRET
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7RECLEVERRRETCODE ON SDSADM.STD_HL7RECLEVERRRET
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7RECLEVERRRETNAME ON SDSADM.STD_HL7RECLEVERRRET
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7RecLevErrRet
after DELETE
ON SDSADM.STD_HL7RECLEVERRRET
BEGIN
	-- update the table for STD_HL7RecLevErrRet operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevErrRet';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7RecLevErrRet
after INSERT
ON SDSADM.STD_HL7RECLEVERRRET
BEGIN
	-- update the table for STD_HL7RecLevErrRet operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevErrRet';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7RecLevErrRet
after UPDATE
ON SDSADM.STD_HL7RECLEVERRRET
BEGIN
	-- update the table for STD_HL7RecLevErrRet operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7RecLevErrRet';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7RECLEVERRRET FOR SDSADM.STD_HL7RECLEVERRRET;


ALTER TABLE SDSADM.STD_HL7RECLEVERRRET ADD (
  CONSTRAINT PK_STD_HL7RECLEVERRRET
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7RECLEVERRRET
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7RECLEVERRRETCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7RECLEVERRRETCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7RECLEVERRRETNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7RECLEVERRRETNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7RECLEVERRRET TO ADR;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRET TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRET TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRET TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7RECLEVERRRET TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRET TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7RECLEVERRRET TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRET TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7RECLEVERRRET TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QUERYRESULTSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QUERYRESULTSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QUERYRESULTSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QUERYRESULTSHISTORY ON SDSADM.STD_HL7QUERYRESULTSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QueryResultsHstry
after DELETE
ON SDSADM.STD_HL7QUERYRESULTSHISTORY
BEGIN
	-- update the table for STD_HL7QueryResultsHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryResultsHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QueryResultsHstry
after INSERT
ON SDSADM.STD_HL7QUERYRESULTSHISTORY
BEGIN
	-- update the table for STD_HL7QueryResultsHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryResultsHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QueryResultsHstry
after UPDATE
ON SDSADM.STD_HL7QUERYRESULTSHISTORY
BEGIN
	-- update the table for STD_HL7QueryResultsHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryResultsHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QUERYRESULTSHISTORY FOR SDSADM.STD_HL7QUERYRESULTSHISTORY;


ALTER TABLE SDSADM.STD_HL7QUERYRESULTSHISTORY ADD (
  CONSTRAINT PK_STD_HL7QUERYRESULTSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QUERYRESULTSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7QUERYRESULTSHISTORY ADD (
  CONSTRAINT FKSTD_HL7QUERYRESULTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7QUERYRESULTS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QUERYRESULTSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QUERYRESULTSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QUERYRESULTSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QUERYRESULTS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QUERYRESULTS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QUERYRESULTS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QUERYRESULTS ON SDSADM.STD_HL7QUERYRESULTS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QUERYRESULTSCODE ON SDSADM.STD_HL7QUERYRESULTS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QUERYRESULTSNAME ON SDSADM.STD_HL7QUERYRESULTS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QueryResults
after DELETE
ON SDSADM.STD_HL7QUERYRESULTS
BEGIN
	-- update the table for STD_HL7QueryResults operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryResults';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QueryResults
after INSERT
ON SDSADM.STD_HL7QUERYRESULTS
BEGIN
	-- update the table for STD_HL7QueryResults operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryResults';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QueryResults
after UPDATE
ON SDSADM.STD_HL7QUERYRESULTS
BEGIN
	-- update the table for STD_HL7QueryResults operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryResults';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QUERYRESULTS FOR SDSADM.STD_HL7QUERYRESULTS;


ALTER TABLE SDSADM.STD_HL7QUERYRESULTS ADD (
  CONSTRAINT PK_STD_HL7QUERYRESULTS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QUERYRESULTS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QUERYRESULTSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7QUERYRESULTSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QUERYRESULTSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7QUERYRESULTSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QUERYRESULTS TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTS TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTS TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QUERYRESULTS TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QUERYRESULTS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESULTS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QUERYRESPONSESTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QUERYRESPONSESTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QUERYRESPONSESTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QRYRESPSTATUS ON SDSADM.STD_HL7QUERYRESPONSESTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QRYRESPSTATUSCODE ON SDSADM.STD_HL7QUERYRESPONSESTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QRYRESPSTATUSNAME ON SDSADM.STD_HL7QUERYRESPONSESTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QryRespStatus
after DELETE
ON SDSADM.STD_HL7QUERYRESPONSESTATUS
BEGIN
	-- update the table for STD_HL7QueryResponseStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryResponseStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QryRespStatus
after INSERT
ON SDSADM.STD_HL7QUERYRESPONSESTATUS
BEGIN
	-- update the table for STD_HL7QueryResponseStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryResponseStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QryRespStatus
after UPDATE
ON SDSADM.STD_HL7QUERYRESPONSESTATUS
BEGIN
	-- update the table for STD_HL7QueryResponseStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryResponseStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QUERYRESPONSESTATUS FOR SDSADM.STD_HL7QUERYRESPONSESTATUS;


ALTER TABLE SDSADM.STD_HL7QUERYRESPONSESTATUS ADD (
  CONSTRAINT PK_STD_HL7QRYRESPSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QRYRESPSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QRYRESPSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7QRYRESPSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QRYRESPSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7QRYRESPSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QUERYRESPONSESTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESPONSESTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESPONSESTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESPONSESTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QUERYRESPONSESTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESPONSESTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QUERYRESPONSESTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESPONSESTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QUERYRESPONSESTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QUERYPRIORITYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QUERYPRIORITYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QUERYPRIORITYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QUERYPRIORITYHISTORY ON SDSADM.STD_HL7QUERYPRIORITYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QueryPriorityHstry
after DELETE
ON SDSADM.STD_HL7QUERYPRIORITYHISTORY
BEGIN
	-- update the table for STD_HL7QueryPriorityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryPriorityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QueryPriorityHstry
after INSERT
ON SDSADM.STD_HL7QUERYPRIORITYHISTORY
BEGIN
	-- update the table for STD_HL7QueryPriorityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryPriorityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QueryPriorityHstry
after UPDATE
ON SDSADM.STD_HL7QUERYPRIORITYHISTORY
BEGIN
	-- update the table for STD_HL7QueryPriorityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryPriorityHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QUERYPRIORITYHISTORY FOR SDSADM.STD_HL7QUERYPRIORITYHISTORY;


ALTER TABLE SDSADM.STD_HL7QUERYPRIORITYHISTORY ADD (
  CONSTRAINT PK_STD_HL7QUERYPRIORITYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QUERYPRIORITYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7QUERYPRIORITYHISTORY ADD (
  CONSTRAINT FKSTD_HL7QUERYPRRTYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7QUERYPRIORITY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QUERYPRIORITYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QUERYPRIORITYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QUERYPRIORITYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QUERYPRIORITY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QUERYPRIORITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QUERYPRIORITY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(1 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QUERYPRIORITY ON SDSADM.STD_HL7QUERYPRIORITY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QUERYPRIORITYCODE ON SDSADM.STD_HL7QUERYPRIORITY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QUERYPRIORITYNAME ON SDSADM.STD_HL7QUERYPRIORITY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QueryPriority
after DELETE
ON SDSADM.STD_HL7QUERYPRIORITY
BEGIN
	-- update the table for STD_HL7QueryPriority operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryPriority';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QueryPriority
after INSERT
ON SDSADM.STD_HL7QUERYPRIORITY
BEGIN
	-- update the table for STD_HL7QueryPriority operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryPriority';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QueryPriority
after UPDATE
ON SDSADM.STD_HL7QUERYPRIORITY
BEGIN
	-- update the table for STD_HL7QueryPriority operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QueryPriority';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QUERYPRIORITY FOR SDSADM.STD_HL7QUERYPRIORITY;


ALTER TABLE SDSADM.STD_HL7QUERYPRIORITY ADD (
  CONSTRAINT PK_STD_HL7QUERYPRIORITY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QUERYPRIORITY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QUERYPRIORITYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7QUERYPRIORITYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QUERYPRIORITYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7QUERYPRIORITYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QUERYPRIORITY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QUERYPRIORITY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QUERYPRIORITY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QUERYPRIORITY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QUANTITYLIMITEDREQUEST
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QUANTITYLIMITEDREQUEST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QUANTITYLIMITEDREQUEST
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QUANLIMREQ ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QUANLIMREQCODE ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QUANLIMREQNAME ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QuanLimReq
after DELETE
ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST
BEGIN
	-- update the table for STD_HL7QuantityLimitedRequest operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QuantityLimitedRequest';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QuanLimReq
after INSERT
ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST
BEGIN
	-- update the table for STD_HL7QuantityLimitedRequest operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QuantityLimitedRequest';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QuanLimReq
after UPDATE
ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST
BEGIN
	-- update the table for STD_HL7QuantityLimitedRequest operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QuantityLimitedRequest';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QUANTITYLIMITEDREQUEST FOR SDSADM.STD_HL7QUANTITYLIMITEDREQUEST;


ALTER TABLE SDSADM.STD_HL7QUANTITYLIMITEDREQUEST ADD (
  CONSTRAINT PK_STD_HL7QUANLIMREQ
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QUANLIMREQ
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QUANLIMREQCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7QUANLIMREQCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QUANLIMREQNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7QUANLIMREQNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QUANTITYLIMITEDREQUEST TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QUANLIMREQHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QUANLIMREQHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QUANLIMREQHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QUANLIMREQHISTORY ON SDSADM.STD_HL7QUANLIMREQHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QuanLimReqHistory
after DELETE
ON SDSADM.STD_HL7QUANLIMREQHISTORY
BEGIN
	-- update the table for STD_HL7QuanLimReqHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QuanLimReqHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QuanLimReqHistory
after INSERT
ON SDSADM.STD_HL7QUANLIMREQHISTORY
BEGIN
	-- update the table for STD_HL7QuanLimReqHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QuanLimReqHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QuanLimReqHistory
after UPDATE
ON SDSADM.STD_HL7QUANLIMREQHISTORY
BEGIN
	-- update the table for STD_HL7QuanLimReqHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QuanLimReqHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QUANLIMREQHISTORY FOR SDSADM.STD_HL7QUANLIMREQHISTORY;


ALTER TABLE SDSADM.STD_HL7QUANLIMREQHISTORY ADD (
  CONSTRAINT PK_STD_HL7QUANLIMREQHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QUANLIMREQHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7QUANLIMREQHISTORY ADD (
  CONSTRAINT FKSTD_HL7QUANLIMREQHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7QUANTITYLIMITEDREQUEST (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QUANLIMREQHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QUANLIMREQHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QUANLIMREQHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QUANLIMREQHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QUANLIMREQHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QUANLIMREQHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QUANLIMREQHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QUANLIMREQHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QUANLIMREQHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QRYRESPSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QRYRESPSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QRYRESPSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QRYRESPSTATUSHISTORY ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QryRespStatusHstry
after DELETE
ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY
BEGIN
	-- update the table for STD_HL7QryRespStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QryRespStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QryRespStatusHstry
after INSERT
ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY
BEGIN
	-- update the table for STD_HL7QryRespStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QryRespStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QryRespStatusHstry
after UPDATE
ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY
BEGIN
	-- update the table for STD_HL7QryRespStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QryRespStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QRYRESPSTATUSHISTORY FOR SDSADM.STD_HL7QRYRESPSTATUSHISTORY;


ALTER TABLE SDSADM.STD_HL7QRYRESPSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_HL7QRYRESPSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QRYRESPSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7QRYRESPSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_HL7QRYRESPSTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7QUERYRESPONSESTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QRYRESPFMTCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QRYRESPFMTCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QRYRESPFMTCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QRYRESPFMTCODEHSTRY ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QryRespFmtCdHstry
after DELETE
ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY
BEGIN
	-- update the table for STD_HL7QryRespFmtCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QryRespFmtCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QryRespFmtCdHstry
after INSERT
ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY
BEGIN
	-- update the table for STD_HL7QryRespFmtCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QryRespFmtCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QryRespFmtCdHstry
after UPDATE
ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY
BEGIN
	-- update the table for STD_HL7QryRespFmtCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QryRespFmtCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QRYRESPFMTCODEHISTORY FOR SDSADM.STD_HL7QRYRESPFMTCODEHISTORY;


ALTER TABLE SDSADM.STD_HL7QRYRESPFMTCODEHISTORY ADD (
  CONSTRAINT PK_STD_HL7QRYRESPFMTCODEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QRYRESPFMTCODEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7QRYRESPFMTCODEHISTORY ADD (
  CONSTRAINT FKSTD_HL7QRYRESPFMTCDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7QRYRESPFMTCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7QRYRESPFMTCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7QRYRESPFMTCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7QRYRESPFMTCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(40 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7QRYRESPFMTCODE ON SDSADM.STD_HL7QRYRESPFMTCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QRYRESPFMTCODECODE ON SDSADM.STD_HL7QRYRESPFMTCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7QRYRESPFMTCODENAME ON SDSADM.STD_HL7QRYRESPFMTCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7QryRespFmtCode
after DELETE
ON SDSADM.STD_HL7QRYRESPFMTCODE
BEGIN
	-- update the table for STD_HL7QryRespFmtCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QryRespFmtCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7QryRespFmtCode
after INSERT
ON SDSADM.STD_HL7QRYRESPFMTCODE
BEGIN
	-- update the table for STD_HL7QryRespFmtCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QryRespFmtCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7QryRespFmtCode
after UPDATE
ON SDSADM.STD_HL7QRYRESPFMTCODE
BEGIN
	-- update the table for STD_HL7QryRespFmtCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7QryRespFmtCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7QRYRESPFMTCODE FOR SDSADM.STD_HL7QRYRESPFMTCODE;


ALTER TABLE SDSADM.STD_HL7QRYRESPFMTCODE ADD (
  CONSTRAINT PK_STD_HL7QRYRESPFMTCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7QRYRESPFMTCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QRYRESPFMTCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7QRYRESPFMTCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7QRYRESPFMTCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7QRYRESPFMTCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7QRYRESPFMTCODE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7QRYRESPFMTCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7QRYRESPFMTCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7QRYRESPFMTCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7PROCMODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7PROCMODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7PROCMODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7PROCMODEHISTORY ON SDSADM.STD_HL7PROCMODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ProcModeHistory
after DELETE
ON SDSADM.STD_HL7PROCMODEHISTORY
BEGIN
	-- update the table for STD_HL7ProcModeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcModeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ProcModeHistory
after INSERT
ON SDSADM.STD_HL7PROCMODEHISTORY
BEGIN
	-- update the table for STD_HL7ProcModeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcModeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ProcModeHistory
after UPDATE
ON SDSADM.STD_HL7PROCMODEHISTORY
BEGIN
	-- update the table for STD_HL7ProcModeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcModeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7PROCMODEHISTORY FOR SDSADM.STD_HL7PROCMODEHISTORY;


ALTER TABLE SDSADM.STD_HL7PROCMODEHISTORY ADD (
  CONSTRAINT PK_STD_HL7PROCMODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7PROCMODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7PROCMODEHISTORY ADD (
  CONSTRAINT FKSTD_HL7PROCMODEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7PROCESSINGMODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7PROCMODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7PROCMODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7PROCMODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7PROCMODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7PROCMODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7PROCMODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7PROCMODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7PROCMODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7PROCMODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7PROCIDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7PROCIDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7PROCIDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7PROCIDHISTORY ON SDSADM.STD_HL7PROCIDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ProcIDHistory
after DELETE
ON SDSADM.STD_HL7PROCIDHISTORY
BEGIN
	-- update the table for STD_HL7ProcIDHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcIDHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ProcIDHistory
after INSERT
ON SDSADM.STD_HL7PROCIDHISTORY
BEGIN
	-- update the table for STD_HL7ProcIDHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcIDHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ProcIDHistory
after UPDATE
ON SDSADM.STD_HL7PROCIDHISTORY
BEGIN
	-- update the table for STD_HL7ProcIDHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcIDHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7PROCIDHISTORY FOR SDSADM.STD_HL7PROCIDHISTORY;


ALTER TABLE SDSADM.STD_HL7PROCIDHISTORY ADD (
  CONSTRAINT PK_STD_HL7PROCIDHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7PROCIDHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7PROCIDHISTORY ADD (
  CONSTRAINT FKSTD_HL7PROCIDHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7PROCESSINGID (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7PROCIDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7PROCIDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7PROCIDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7PROCIDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7PROCIDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7PROCIDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7PROCIDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7PROCIDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7PROCIDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7PROCESSINGMODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7PROCESSINGMODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7PROCESSINGMODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7PROCMODE ON SDSADM.STD_HL7PROCESSINGMODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7PROCMODECODE ON SDSADM.STD_HL7PROCESSINGMODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7PROCMODENAME ON SDSADM.STD_HL7PROCESSINGMODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ProcMode
after DELETE
ON SDSADM.STD_HL7PROCESSINGMODE
BEGIN
	-- update the table for STD_HL7ProcessingMode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcessingMode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ProcMode
after INSERT
ON SDSADM.STD_HL7PROCESSINGMODE
BEGIN
	-- update the table for STD_HL7ProcessingMode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcessingMode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ProcMode
after UPDATE
ON SDSADM.STD_HL7PROCESSINGMODE
BEGIN
	-- update the table for STD_HL7ProcessingMode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcessingMode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7PROCESSINGMODE FOR SDSADM.STD_HL7PROCESSINGMODE;


ALTER TABLE SDSADM.STD_HL7PROCESSINGMODE ADD (
  CONSTRAINT PK_STD_HL7PROCMODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7PROCMODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7PROCMODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7PROCMODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7PROCMODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7PROCMODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7PROCESSINGMODE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGMODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGMODE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGMODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7PROCESSINGMODE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGMODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7PROCESSINGMODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGMODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGMODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7PROCESSINGID
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7PROCESSINGID CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7PROCESSINGID
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(20 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7PROCID ON SDSADM.STD_HL7PROCESSINGID
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7PROCIDCODE ON SDSADM.STD_HL7PROCESSINGID
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7PROCIDNAME ON SDSADM.STD_HL7PROCESSINGID
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ProcID
after DELETE
ON SDSADM.STD_HL7PROCESSINGID
BEGIN
	-- update the table for STD_HL7ProcessingID operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcessingID';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ProcID
after INSERT
ON SDSADM.STD_HL7PROCESSINGID
BEGIN
	-- update the table for STD_HL7ProcessingID operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcessingID';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ProcID
after UPDATE
ON SDSADM.STD_HL7PROCESSINGID
BEGIN
	-- update the table for STD_HL7ProcessingID operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ProcessingID';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7PROCESSINGID FOR SDSADM.STD_HL7PROCESSINGID;


ALTER TABLE SDSADM.STD_HL7PROCESSINGID ADD (
  CONSTRAINT PK_STD_HL7PROCID
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7PROCID
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7PROCIDCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7PROCIDCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7PROCIDNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7PROCIDNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7PROCESSINGID TO ADR;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGID TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGID TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGID TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7PROCESSINGID TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGID TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7PROCESSINGID TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGID TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7PROCESSINGID TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7PRIMKEYVALTYPEHSTRY ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7PrimKeyValTypHstry
after DELETE
ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY
BEGIN
	-- update the table for STD_HL7PrimKeyValTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7PrimKeyValTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7PrimKeyValTypHstry
after INSERT
ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY
BEGIN
	-- update the table for STD_HL7PrimKeyValTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7PrimKeyValTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7PrimKeyValTypHstry
after UPDATE
ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY
BEGIN
	-- update the table for STD_HL7PrimKeyValTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7PrimKeyValTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7PRIMKEYVALTYPEHISTORY FOR SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY;


ALTER TABLE SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY ADD (
  CONSTRAINT PK_STD_HL7PRIMKEYVALTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7PRIMKEYVALTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY ADD (
  CONSTRAINT FKSTD_HL7PRIMKEYVLTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7PRIMARYKEYVALUETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7PRIMARYKEYVALUETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7PRIMARYKEYVALUETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7PRIMARYKEYVALUETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7PRIMKEYVALTYPE ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7PRIMKEYVALTYPECODE ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7PRIMKEYVALTYPENAME ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7PrimKeyValType
after DELETE
ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE
BEGIN
	-- update the table for STD_HL7PrimaryKeyValueType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7PrimaryKeyValueType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7PrimKeyValType
after INSERT
ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE
BEGIN
	-- update the table for STD_HL7PrimaryKeyValueType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7PrimaryKeyValueType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7PrimKeyValType
after UPDATE
ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE
BEGIN
	-- update the table for STD_HL7PrimaryKeyValueType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7PrimaryKeyValueType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7PRIMARYKEYVALUETYPE FOR SDSADM.STD_HL7PRIMARYKEYVALUETYPE;


ALTER TABLE SDSADM.STD_HL7PRIMARYKEYVALUETYPE ADD (
  CONSTRAINT PK_STD_HL7PRIMKEYVALTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7PRIMKEYVALTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7PRIMKEYVALTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7PRIMKEYVALTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7PRIMKEYVALTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7PRIMKEYVALTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7PRIMARYKEYVALUETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7OBSERVRESULTCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7OBSERVRESULTCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7OBSERVRESULTCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7OBSERVRESULTCDHSTRY ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ObservRsltCdHstry
after DELETE
ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY
BEGIN
	-- update the table for STD_HL7ObservResultCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ObservResultCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ObservRsltCdHstry
after INSERT
ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY
BEGIN
	-- update the table for STD_HL7ObservResultCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ObservResultCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ObservRsltCdHstry
after UPDATE
ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY
BEGIN
	-- update the table for STD_HL7ObservResultCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ObservResultCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7OBSERVRESULTCODEHISTORY FOR SDSADM.STD_HL7OBSERVRESULTCODEHISTORY;


ALTER TABLE SDSADM.STD_HL7OBSERVRESULTCODEHISTORY ADD (
  CONSTRAINT PK_STD_HL7OBSERVRESULTCDHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7OBSERVRESULTCDHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7OBSERVRESULTCODEHISTORY ADD (
  CONSTRAINT FKSTD_HL7OBSERVRSLTCDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7OBSERVRESULTCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7OBSERVRESULTCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7OBSERVRESULTCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7OBSERVRESULTCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(1000 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7OBSERVRESULTCODE ON SDSADM.STD_HL7OBSERVRESULTCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7OBSERVRESULTCODECODE ON SDSADM.STD_HL7OBSERVRESULTCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7OBSERVRESULTCODENAME ON SDSADM.STD_HL7OBSERVRESULTCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ObservResultCode
after DELETE
ON SDSADM.STD_HL7OBSERVRESULTCODE
BEGIN
	-- update the table for STD_HL7ObservResultCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ObservResultCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ObservResultCode
after INSERT
ON SDSADM.STD_HL7OBSERVRESULTCODE
BEGIN
	-- update the table for STD_HL7ObservResultCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ObservResultCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ObservResultCode
after UPDATE
ON SDSADM.STD_HL7OBSERVRESULTCODE
BEGIN
	-- update the table for STD_HL7ObservResultCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ObservResultCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7OBSERVRESULTCODE FOR SDSADM.STD_HL7OBSERVRESULTCODE;


ALTER TABLE SDSADM.STD_HL7OBSERVRESULTCODE ADD (
  CONSTRAINT PK_STD_HL7OBSERVRESULTCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7OBSERVRESULTCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7OBSERVRESULTCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7OBSERVRESULTCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7OBSERVRESULTCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7OBSERVRESULTCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7OBSERVRESULTCODE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7OBSERVRESULTCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7OBSERVRESULTCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7OBSERVRESULTCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7MESSAGETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7MESSAGETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7MESSAGETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7MESSAGETYPEHISTORY ON SDSADM.STD_HL7MESSAGETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7MessageTypeHistory
after DELETE
ON SDSADM.STD_HL7MESSAGETYPEHISTORY
BEGIN
	-- update the table for STD_HL7MessageTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7MessageTypeHistory
after INSERT
ON SDSADM.STD_HL7MESSAGETYPEHISTORY
BEGIN
	-- update the table for STD_HL7MessageTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7MessageTypeHistory
after UPDATE
ON SDSADM.STD_HL7MESSAGETYPEHISTORY
BEGIN
	-- update the table for STD_HL7MessageTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7MESSAGETYPEHISTORY FOR SDSADM.STD_HL7MESSAGETYPEHISTORY;


ALTER TABLE SDSADM.STD_HL7MESSAGETYPEHISTORY ADD (
  CONSTRAINT PK_STD_HL7MESSAGETYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7MESSAGETYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7MESSAGETYPEHISTORY ADD (
  CONSTRAINT FKSTD_HL7MESSAGETYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7MESSAGETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7MESSAGETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7MESSAGETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7MESSAGETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7MESSAGETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7MESSAGETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7MESSAGETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(3 BYTE)                     NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7MESSAGETYPE ON SDSADM.STD_HL7MESSAGETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7MESSAGETYPECODE ON SDSADM.STD_HL7MESSAGETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7MessageType
after DELETE
ON SDSADM.STD_HL7MESSAGETYPE
BEGIN
	-- update the table for STD_HL7MessageType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7MessageType
after INSERT
ON SDSADM.STD_HL7MESSAGETYPE
BEGIN
	-- update the table for STD_HL7MessageType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7MessageType
after UPDATE
ON SDSADM.STD_HL7MESSAGETYPE
BEGIN
	-- update the table for STD_HL7MessageType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7MESSAGETYPE FOR SDSADM.STD_HL7MESSAGETYPE;


ALTER TABLE SDSADM.STD_HL7MESSAGETYPE ADD (
  CONSTRAINT PK_STD_HL7MESSAGETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7MESSAGETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7MESSAGETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7MESSAGETYPECODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7MESSAGETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7MESSAGETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7MESSAGETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7MESSAGETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7MESSAGESTRUCHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7MESSAGESTRUCHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7MESSAGESTRUCHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7MESSAGESTRUCHISTORY ON SDSADM.STD_HL7MESSAGESTRUCHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7MessageStrucHstry
after DELETE
ON SDSADM.STD_HL7MESSAGESTRUCHISTORY
BEGIN
	-- update the table for STD_HL7MessageStrucHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageStrucHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7MessageStrucHstry
after INSERT
ON SDSADM.STD_HL7MESSAGESTRUCHISTORY
BEGIN
	-- update the table for STD_HL7MessageStrucHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageStrucHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7MessageStrucHstry
after UPDATE
ON SDSADM.STD_HL7MESSAGESTRUCHISTORY
BEGIN
	-- update the table for STD_HL7MessageStrucHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageStrucHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7MESSAGESTRUCHISTORY FOR SDSADM.STD_HL7MESSAGESTRUCHISTORY;


ALTER TABLE SDSADM.STD_HL7MESSAGESTRUCHISTORY ADD (
  CONSTRAINT PK_STD_HL7MESSAGESTRUCHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7MESSAGESTRUCHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7MESSAGESTRUCHISTORY ADD (
  CONSTRAINT FKSTD_HL7MESSAGESTRUCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7MESSAGESTRUC (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7MESSAGESTRUCHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUCHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUCHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUCHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7MESSAGESTRUCHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUCHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7MESSAGESTRUCHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUCHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUCHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7MESSAGESTRUC
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7MESSAGESTRUC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7MESSAGESTRUC
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(7 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7MESSAGESTRUC ON SDSADM.STD_HL7MESSAGESTRUC
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7MESSAGESTRUCCODE ON SDSADM.STD_HL7MESSAGESTRUC
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7MessageStruc
after DELETE
ON SDSADM.STD_HL7MESSAGESTRUC
BEGIN
	-- update the table for STD_HL7MessageStruc operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageStruc';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7MessageStruc
after INSERT
ON SDSADM.STD_HL7MESSAGESTRUC
BEGIN
	-- update the table for STD_HL7MessageStruc operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageStruc';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7MessageStruc
after UPDATE
ON SDSADM.STD_HL7MESSAGESTRUC
BEGIN
	-- update the table for STD_HL7MessageStruc operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MessageStruc';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7MESSAGESTRUC FOR SDSADM.STD_HL7MESSAGESTRUC;


ALTER TABLE SDSADM.STD_HL7MESSAGESTRUC ADD (
  CONSTRAINT PK_STD_HL7MESSAGESTRUC
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7MESSAGESTRUC
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7MESSAGESTRUCCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7MESSAGESTRUCCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7MESSAGESTRUC TO ADR;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUC TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUC TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUC TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7MESSAGESTRUC TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUC TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7MESSAGESTRUC TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUC TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7MESSAGESTRUC TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7MASTERFILEIDCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7MASTERFILEIDCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7MASTERFILEIDCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7MASTERFILEIDCDHSTRY ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7MasterFlIDCdHstry
after DELETE
ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY
BEGIN
	-- update the table for STD_HL7MasterFileIDCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MasterFileIDCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7MasterFlIDCdHstry
after INSERT
ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY
BEGIN
	-- update the table for STD_HL7MasterFileIDCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MasterFileIDCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7MasterFlIDCdHstry
after UPDATE
ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY
BEGIN
	-- update the table for STD_HL7MasterFileIDCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MasterFileIDCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7MASTERFILEIDCODEHISTORY FOR SDSADM.STD_HL7MASTERFILEIDCODEHISTORY;


ALTER TABLE SDSADM.STD_HL7MASTERFILEIDCODEHISTORY ADD (
  CONSTRAINT PK_STD_HL7MASTERFILEIDCDHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7MASTERFILEIDCDHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7MASTERFILEIDCODEHISTORY ADD (
  CONSTRAINT FKSTD_HL7MASTERFLIDCDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7MASTERFILEIDCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7MASTERFILEIDCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7MASTERFILEIDCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7MASTERFILEIDCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(3 BYTE)                     NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7MASTERFILEIDCODE ON SDSADM.STD_HL7MASTERFILEIDCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7MASTERFILEIDCODECODE ON SDSADM.STD_HL7MASTERFILEIDCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7MASTERFILEIDCODENAME ON SDSADM.STD_HL7MASTERFILEIDCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7MasterFileIDCode
after DELETE
ON SDSADM.STD_HL7MASTERFILEIDCODE
BEGIN
	-- update the table for STD_HL7MasterFileIDCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MasterFileIDCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7MasterFileIDCode
after INSERT
ON SDSADM.STD_HL7MASTERFILEIDCODE
BEGIN
	-- update the table for STD_HL7MasterFileIDCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MasterFileIDCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7MasterFileIDCode
after UPDATE
ON SDSADM.STD_HL7MASTERFILEIDCODE
BEGIN
	-- update the table for STD_HL7MasterFileIDCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7MasterFileIDCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7MASTERFILEIDCODE FOR SDSADM.STD_HL7MASTERFILEIDCODE;


ALTER TABLE SDSADM.STD_HL7MASTERFILEIDCODE ADD (
  CONSTRAINT PK_STD_HL7MASTERFILEIDCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7MASTERFILEIDCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7MASTERFILEIDCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7MASTERFILEIDCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7MASTERFILEIDCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7MASTERFILEIDCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7MASTERFILEIDCODE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7MASTERFILEIDCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7MASTERFILEIDCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7MASTERFILEIDCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7FILELEVELEVENTHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7FILELEVELEVENTHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7FILELEVELEVENTHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7FILELEVELEVENTHSTRY ON SDSADM.STD_HL7FILELEVELEVENTHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7FileLevelEvntHstry
after DELETE
ON SDSADM.STD_HL7FILELEVELEVENTHISTORY
BEGIN
	-- update the table for STD_HL7FileLevelEventHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7FileLevelEventHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7FileLevelEvntHstry
after INSERT
ON SDSADM.STD_HL7FILELEVELEVENTHISTORY
BEGIN
	-- update the table for STD_HL7FileLevelEventHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7FileLevelEventHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7FileLevelEvntHstry
after UPDATE
ON SDSADM.STD_HL7FILELEVELEVENTHISTORY
BEGIN
	-- update the table for STD_HL7FileLevelEventHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7FileLevelEventHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7FILELEVELEVENTHISTORY FOR SDSADM.STD_HL7FILELEVELEVENTHISTORY;


ALTER TABLE SDSADM.STD_HL7FILELEVELEVENTHISTORY ADD (
  CONSTRAINT PK_STD_HL7FILELEVELEVENTHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7FILELEVELEVENTHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7FILELEVELEVENTHISTORY ADD (
  CONSTRAINT FKSTD_HL7FILELVLEVNTHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7FILELEVELEVENT (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7FILELEVELEVENTHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENTHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENTHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENTHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7FILELEVELEVENTHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENTHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7FILELEVELEVENTHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENTHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENTHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7FILELEVELEVENT
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7FILELEVELEVENT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7FILELEVELEVENT
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(3 BYTE)                     NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7FILELEVELEVENT ON SDSADM.STD_HL7FILELEVELEVENT
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7FILELEVELEVENTCODE ON SDSADM.STD_HL7FILELEVELEVENT
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7FILELEVELEVENTNAME ON SDSADM.STD_HL7FILELEVELEVENT
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7FileLevelEvent
after DELETE
ON SDSADM.STD_HL7FILELEVELEVENT
BEGIN
	-- update the table for STD_HL7FileLevelEvent operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7FileLevelEvent';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7FileLevelEvent
after INSERT
ON SDSADM.STD_HL7FILELEVELEVENT
BEGIN
	-- update the table for STD_HL7FileLevelEvent operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7FileLevelEvent';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7FileLevelEvent
after UPDATE
ON SDSADM.STD_HL7FILELEVELEVENT
BEGIN
	-- update the table for STD_HL7FileLevelEvent operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7FileLevelEvent';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7FILELEVELEVENT FOR SDSADM.STD_HL7FILELEVELEVENT;


ALTER TABLE SDSADM.STD_HL7FILELEVELEVENT ADD (
  CONSTRAINT PK_STD_HL7FILELEVELEVENT
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7FILELEVELEVENT
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7FILELEVELEVENTCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7FILELEVELEVENTCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7FILELEVELEVENTNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7FILELEVELEVENTNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7FILELEVELEVENT TO ADR;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENT TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENT TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENT TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7FILELEVELEVENT TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENT TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7FILELEVELEVENT TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENT TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7FILELEVELEVENT TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7EVENTTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7EVENTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7EVENTTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7EVENTTYPEHISTORY ON SDSADM.STD_HL7EVENTTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7EventTypeHistory
after DELETE
ON SDSADM.STD_HL7EVENTTYPEHISTORY
BEGIN
	-- update the table for STD_HL7EventTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7EventTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7EventTypeHistory
after INSERT
ON SDSADM.STD_HL7EVENTTYPEHISTORY
BEGIN
	-- update the table for STD_HL7EventTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7EventTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7EventTypeHistory
after UPDATE
ON SDSADM.STD_HL7EVENTTYPEHISTORY
BEGIN
	-- update the table for STD_HL7EventTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7EventTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7EVENTTYPEHISTORY FOR SDSADM.STD_HL7EVENTTYPEHISTORY;


ALTER TABLE SDSADM.STD_HL7EVENTTYPEHISTORY ADD (
  CONSTRAINT PK_STD_HL7EVENTTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7EVENTTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7EVENTTYPEHISTORY ADD (
  CONSTRAINT FKSTD_HL7EVENTTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7EVENTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7EVENTTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7EVENTTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7EVENTTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7EVENTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7EVENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7EVENTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(6 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7EVENTTYPE ON SDSADM.STD_HL7EVENTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7EVENTTYPECODE ON SDSADM.STD_HL7EVENTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7EVENTTYPENAME ON SDSADM.STD_HL7EVENTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7EventType
after DELETE
ON SDSADM.STD_HL7EVENTTYPE
BEGIN
	-- update the table for STD_HL7EventType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7EventType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7EventType
after INSERT
ON SDSADM.STD_HL7EVENTTYPE
BEGIN
	-- update the table for STD_HL7EventType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7EventType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7EventType
after UPDATE
ON SDSADM.STD_HL7EVENTTYPE
BEGIN
	-- update the table for STD_HL7EventType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7EventType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7EVENTTYPE FOR SDSADM.STD_HL7EVENTTYPE;


ALTER TABLE SDSADM.STD_HL7EVENTTYPE ADD (
  CONSTRAINT PK_STD_HL7EVENTTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7EVENTTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7EVENTTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7EVENTTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7EVENTTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7EVENTTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7EVENTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7EVENTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7EVENTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7EVENTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7DATATYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7DATATYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7DATATYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7DATATYPEHISTORY ON SDSADM.STD_HL7DATATYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7DataTypeHistory
after DELETE
ON SDSADM.STD_HL7DATATYPEHISTORY
BEGIN
	-- update the table for STD_HL7DataTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7DataTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7DataTypeHistory
after INSERT
ON SDSADM.STD_HL7DATATYPEHISTORY
BEGIN
	-- update the table for STD_HL7DataTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7DataTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7DataTypeHistory
after UPDATE
ON SDSADM.STD_HL7DATATYPEHISTORY
BEGIN
	-- update the table for STD_HL7DataTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7DataTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7DATATYPEHISTORY FOR SDSADM.STD_HL7DATATYPEHISTORY;


ALTER TABLE SDSADM.STD_HL7DATATYPEHISTORY ADD (
  CONSTRAINT PK_STD_HL7DATATYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7DATATYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7DATATYPEHISTORY ADD (
  CONSTRAINT FKSTD_HL7DATATYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7DATATYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7DATATYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7DATATYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7DATATYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7DATATYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7DATATYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7DATATYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7DATATYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7DATATYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7DATATYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7DATATYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7DATATYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7DATATYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(70 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7DATATYPE ON SDSADM.STD_HL7DATATYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7DATATYPECODE ON SDSADM.STD_HL7DATATYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7DATATYPENAME ON SDSADM.STD_HL7DATATYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7DataType
after DELETE
ON SDSADM.STD_HL7DATATYPE
BEGIN
	-- update the table for STD_HL7DataType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7DataType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7DataType
after INSERT
ON SDSADM.STD_HL7DATATYPE
BEGIN
	-- update the table for STD_HL7DataType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7DataType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7DataType
after UPDATE
ON SDSADM.STD_HL7DATATYPE
BEGIN
	-- update the table for STD_HL7DataType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7DataType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7DATATYPE FOR SDSADM.STD_HL7DATATYPE;


ALTER TABLE SDSADM.STD_HL7DATATYPE ADD (
  CONSTRAINT PK_STD_HL7DATATYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7DATATYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7DATATYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7DATATYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7DATATYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7DATATYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7DATATYPE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7DATATYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7DATATYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7DATATYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7DATATYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7DATATYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7DATATYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7DATATYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7DATATYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7ACTIONCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7ACTIONCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7ACTIONCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7ACTIONCODEHISTORY ON SDSADM.STD_HL7ACTIONCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ActionCodeHistory
after DELETE
ON SDSADM.STD_HL7ACTIONCODEHISTORY
BEGIN
	-- update the table for STD_HL7ActionCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ActionCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ActionCodeHistory
after INSERT
ON SDSADM.STD_HL7ACTIONCODEHISTORY
BEGIN
	-- update the table for STD_HL7ActionCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ActionCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ActionCodeHistory
after UPDATE
ON SDSADM.STD_HL7ACTIONCODEHISTORY
BEGIN
	-- update the table for STD_HL7ActionCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ActionCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7ACTIONCODEHISTORY FOR SDSADM.STD_HL7ACTIONCODEHISTORY;


ALTER TABLE SDSADM.STD_HL7ACTIONCODEHISTORY ADD (
  CONSTRAINT PK_STD_HL7ACTIONCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7ACTIONCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7ACTIONCODEHISTORY ADD (
  CONSTRAINT FKSTD_HL7ACTIONCODEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7ACTIONCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7ACTIONCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7ACTIONCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7ACTIONCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7ACTIONCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7ACTIONCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7ACTIONCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(15 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7ACTIONCODE ON SDSADM.STD_HL7ACTIONCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7ACTIONCODECODE ON SDSADM.STD_HL7ACTIONCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7ACTIONCODENAME ON SDSADM.STD_HL7ACTIONCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7ActionCode
after DELETE
ON SDSADM.STD_HL7ACTIONCODE
BEGIN
	-- update the table for STD_HL7ActionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ActionCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7ActionCode
after INSERT
ON SDSADM.STD_HL7ACTIONCODE
BEGIN
	-- update the table for STD_HL7ActionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ActionCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7ActionCode
after UPDATE
ON SDSADM.STD_HL7ACTIONCODE
BEGIN
	-- update the table for STD_HL7ActionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7ActionCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7ACTIONCODE FOR SDSADM.STD_HL7ACTIONCODE;


ALTER TABLE SDSADM.STD_HL7ACTIONCODE ADD (
  CONSTRAINT PK_STD_HL7ACTIONCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7ACTIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7ACTIONCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7ACTIONCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7ACTIONCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7ACTIONCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7ACTIONCODE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7ACTIONCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7ACTIONCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7ACTIONCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7ACKTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7ACKTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7ACKTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7ACKTYPEHISTORY ON SDSADM.STD_HL7ACKTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7AckTypeHistory
after DELETE
ON SDSADM.STD_HL7ACKTYPEHISTORY
BEGIN
	-- update the table for STD_HL7AckTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AckTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7AckTypeHistory
after INSERT
ON SDSADM.STD_HL7ACKTYPEHISTORY
BEGIN
	-- update the table for STD_HL7AckTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AckTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7AckTypeHistory
after UPDATE
ON SDSADM.STD_HL7ACKTYPEHISTORY
BEGIN
	-- update the table for STD_HL7AckTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AckTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7ACKTYPEHISTORY FOR SDSADM.STD_HL7ACKTYPEHISTORY;


ALTER TABLE SDSADM.STD_HL7ACKTYPEHISTORY ADD (
  CONSTRAINT PK_STD_HL7ACKTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7ACKTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7ACKTYPEHISTORY ADD (
  CONSTRAINT FKSTD_HL7ACKTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7ACKTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7ACKTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7ACKTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7ACKTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7ACKTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7ACKTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7ACKTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7ACKTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7ACKTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7ACKTYPE ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7ACKTYPECODE ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7ACKTYPENAME ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7AckType
after DELETE
ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE
BEGIN
	-- update the table for STD_HL7AcknowledgementType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AcknowledgementType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7AckType
after INSERT
ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE
BEGIN
	-- update the table for STD_HL7AcknowledgementType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AcknowledgementType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7AckType
after UPDATE
ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE
BEGIN
	-- update the table for STD_HL7AcknowledgementType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AcknowledgementType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7ACKNOWLEDGEMENTTYPE FOR SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE;


ALTER TABLE SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE ADD (
  CONSTRAINT PK_STD_HL7ACKTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7ACKTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7ACKTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7ACKTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7ACKTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7ACKTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7ACKNOWLEDGEMENTCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7ACKNOWLEDGEMENTCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7ACKNOWLEDGEMENTCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7ACKCODE ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7ACKCODECODE ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL7ACKCODENAME ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.DEL4_STD_HL7ACKCODE
after DELETE
ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE
BEGIN
	-- update the table for STD_HL7AcknowledgementCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AcknowledgementCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.INS4_STD_HL7ACKCODE
after INSERT
ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE
BEGIN
	-- update the table for STD_HL7AcknowledgementCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AcknowledgementCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.UPD4_STD_HL7ACKCODE
after UPDATE
ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE
BEGIN
	-- update the table for STD_HL7AcknowledgementCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AcknowledgementCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7ACKNOWLEDGEMENTCODE FOR SDSADM.STD_HL7ACKNOWLEDGEMENTCODE;


ALTER TABLE SDSADM.STD_HL7ACKNOWLEDGEMENTCODE ADD (
  CONSTRAINT PK_STD_HL7ACKCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7ACKCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7ACKCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HL7ACKCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL7ACKCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL7ACKCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE TO ADR;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7ACKNOWLEDGEMENTCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL7ACKCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL7ACKCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL7ACKCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL7ACKCODEHISTORY ON SDSADM.STD_HL7ACKCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL7AckCodeHistory
after DELETE
ON SDSADM.STD_HL7ACKCODEHISTORY
BEGIN
	-- update the table for STD_HL7AckCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AckCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL7AckCodeHistory
after INSERT
ON SDSADM.STD_HL7ACKCODEHISTORY
BEGIN
	-- update the table for STD_HL7AckCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AckCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL7AckCodeHistory
after UPDATE
ON SDSADM.STD_HL7ACKCODEHISTORY
BEGIN
	-- update the table for STD_HL7AckCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL7AckCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL7ACKCODEHISTORY FOR SDSADM.STD_HL7ACKCODEHISTORY;


ALTER TABLE SDSADM.STD_HL7ACKCODEHISTORY ADD (
  CONSTRAINT PK_STD_HL7ACKCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL7ACKCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL7ACKCODEHISTORY ADD (
  CONSTRAINT FKSTD_HL7ACKCODEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL7ACKNOWLEDGEMENTCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL7ACKCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL7ACKCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL7ACKCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL7ACKCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL7ACKCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL7ACKCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL7ACKCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL7ACKCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL7ACKCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL724RACEMAPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL724RACEMAPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL724RACEMAPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL724RACEMAPHISTORY ON SDSADM.STD_HL724RACEMAPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL724RaceMapHistory
after DELETE
ON SDSADM.STD_HL724RACEMAPHISTORY
BEGIN
	-- update the table for STD_HL724RaceMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724RaceMapHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL724RaceMapHistory
after INSERT
ON SDSADM.STD_HL724RACEMAPHISTORY
BEGIN
	-- update the table for STD_HL724RaceMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724RaceMapHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL724RaceMapHistory
after UPDATE
ON SDSADM.STD_HL724RACEMAPHISTORY
BEGIN
	-- update the table for STD_HL724RaceMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724RaceMapHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL724RACEMAPHISTORY FOR SDSADM.STD_HL724RACEMAPHISTORY;


ALTER TABLE SDSADM.STD_HL724RACEMAPHISTORY ADD (
  CONSTRAINT PK_STD_HL724RACEMAPHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL724RACEMAPHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL724RACEMAPHISTORY ADD (
  CONSTRAINT FKSTD_HL724RACEMAPHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL724RACEMAP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL724RACEMAPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL724RACEMAPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL724RACEMAPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL724RACEMAPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL724RACEMAPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL724RACEMAPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL724RACEMAPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL724RACEMAPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL724RACEMAPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL724RACEMAP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL724RACEMAP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL724RACEMAP
(
  ID           NUMBER(20)                       NOT NULL,
  HL7VALUE     VARCHAR2(8 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  RACE_ID      NUMBER(20)                       NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL724RACEMAP ON SDSADM.STD_HL724RACEMAP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL724RACEMAPHL7VALUE ON SDSADM.STD_HL724RACEMAP
(HL7VALUE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL724RACEMAPNAME ON SDSADM.STD_HL724RACEMAP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL724RACEMAPRACE ON SDSADM.STD_HL724RACEMAP
(RACE_ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL724RaceMap
after DELETE
ON SDSADM.STD_HL724RACEMAP
BEGIN
	-- update the table for STD_HL724RaceMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724RaceMap';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL724RaceMap
after INSERT
ON SDSADM.STD_HL724RACEMAP
BEGIN
	-- update the table for STD_HL724RaceMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724RaceMap';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL724RaceMap
after UPDATE
ON SDSADM.STD_HL724RACEMAP
BEGIN
	-- update the table for STD_HL724RaceMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724RaceMap';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL724RACEMAP FOR SDSADM.STD_HL724RACEMAP;


ALTER TABLE SDSADM.STD_HL724RACEMAP ADD (
  CONSTRAINT PK_STD_HL724RACEMAP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL724RACEMAP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL724RACEMAPHL7VALUE
  UNIQUE (HL7VALUE)
  USING INDEX SDSADM.UQSTD_HL724RACEMAPHL7VALUE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL724RACEMAPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL724RACEMAPNAME
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL724RACEMAPRACE
  UNIQUE (RACE_ID)
  USING INDEX SDSADM.UQSTD_HL724RACEMAPRACE
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL724RACEMAP ADD (
  CONSTRAINT FKSTD_HL724RACEMAPRACE 
  FOREIGN KEY (RACE_ID) 
  REFERENCES SDSADM.STD_RACE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL724RACEMAP TO ADR;

GRANT SELECT ON SDSADM.STD_HL724RACEMAP TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL724RACEMAP TO EESRV;

GRANT SELECT ON SDSADM.STD_HL724RACEMAP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL724RACEMAP TO LOBR;

GRANT SELECT ON SDSADM.STD_HL724RACEMAP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL724RACEMAP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL724RACEMAP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL724RACEMAP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL724MARITALSTAMAPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL724MARITALSTAMAPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL724MARITALSTAMAPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL724MARITALSTAMAPHSTRY ON SDSADM.STD_HL724MARITALSTAMAPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL724MaritalStMpHstry
after DELETE
ON SDSADM.STD_HL724MARITALSTAMAPHISTORY
BEGIN
	-- update the table for STD_HL724MaritalStaMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724MaritalStaMapHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL724MaritalStMpHstry
after INSERT
ON SDSADM.STD_HL724MARITALSTAMAPHISTORY
BEGIN
	-- update the table for STD_HL724MaritalStaMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724MaritalStaMapHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL724MaritalStMpHstry
after UPDATE
ON SDSADM.STD_HL724MARITALSTAMAPHISTORY
BEGIN
	-- update the table for STD_HL724MaritalStaMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724MaritalStaMapHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL724MARITALSTAMAPHISTORY FOR SDSADM.STD_HL724MARITALSTAMAPHISTORY;


ALTER TABLE SDSADM.STD_HL724MARITALSTAMAPHISTORY ADD (
  CONSTRAINT PK_STD_HL724MARITALSTAMAPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL724MARITALSTAMAPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL724MARITALSTAMAPHISTORY ADD (
  CONSTRAINT FKSTD_HL724MRTLSTMPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL724MARITALSTAMAP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL724MARITALSTAMAPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL724MARITALSTAMAPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL724MARITALSTAMAPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL724MARITALSTAMAP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL724MARITALSTAMAP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL724MARITALSTAMAP
(
  ID                NUMBER(20)                  NOT NULL,
  HL7VALUE          VARCHAR2(8 BYTE)            NOT NULL,
  NAME              VARCHAR2(80 BYTE)           NOT NULL,
  MARITALSTATUS_ID  NUMBER(20)                  NOT NULL,
  DESCRIPTION       VARCHAR2(250 BYTE),
  VERSION           INTEGER                     NOT NULL,
  CREATED           TIMESTAMP(6)                NOT NULL,
  UPDATED           TIMESTAMP(6),
  CREATEDBY         VARCHAR2(32 BYTE)           NOT NULL,
  UPDATEDBY         VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL724MARITALSTAMAP ON SDSADM.STD_HL724MARITALSTAMAP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL724MARITALSTAMAPHL7VL ON SDSADM.STD_HL724MARITALSTAMAP
(HL7VALUE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL724MARITALSTAMAPNAME ON SDSADM.STD_HL724MARITALSTAMAP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL724MARITALSTMPMRTLSTTS ON SDSADM.STD_HL724MARITALSTAMAP
(MARITALSTATUS_ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL724MaritalStaMap
after DELETE
ON SDSADM.STD_HL724MARITALSTAMAP
BEGIN
	-- update the table for STD_HL724MaritalStaMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724MaritalStaMap';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL724MaritalStaMap
after INSERT
ON SDSADM.STD_HL724MARITALSTAMAP
BEGIN
	-- update the table for STD_HL724MaritalStaMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724MaritalStaMap';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL724MaritalStaMap
after UPDATE
ON SDSADM.STD_HL724MARITALSTAMAP
BEGIN
	-- update the table for STD_HL724MaritalStaMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724MaritalStaMap';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL724MARITALSTAMAP FOR SDSADM.STD_HL724MARITALSTAMAP;


ALTER TABLE SDSADM.STD_HL724MARITALSTAMAP ADD (
  CONSTRAINT PK_STD_HL724MARITALSTAMAP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL724MARITALSTAMAP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL724MARITALSTAMAPHL7VL
  UNIQUE (HL7VALUE)
  USING INDEX SDSADM.UQSTD_HL724MARITALSTAMAPHL7VL
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL724MARITALSTAMAPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL724MARITALSTAMAPNAME
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL724MARITALSTMPMRTLSTTS
  UNIQUE (MARITALSTATUS_ID)
  USING INDEX SDSADM.UQSTD_HL724MARITALSTMPMRTLSTTS
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL724MARITALSTAMAP ADD (
  CONSTRAINT FKSTD_HL724MARITALSTMPMRTLSTTS 
  FOREIGN KEY (MARITALSTATUS_ID) 
  REFERENCES SDSADM.STD_MARITALSTATUS (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL724MARITALSTAMAP TO ADR;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAP TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAP TO EESRV;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL724MARITALSTAMAP TO LOBR;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL724MARITALSTAMAP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL724MARITALSTAMAP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL724ETHNICITYMAPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL724ETHNICITYMAPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL724ETHNICITYMAPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL724ETHNICITYMAPHSTRY ON SDSADM.STD_HL724ETHNICITYMAPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL724EthnicityMpHstry
after DELETE
ON SDSADM.STD_HL724ETHNICITYMAPHISTORY
BEGIN
	-- update the table for STD_HL724EthnicityMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724EthnicityMapHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL724EthnicityMpHstry
after INSERT
ON SDSADM.STD_HL724ETHNICITYMAPHISTORY
BEGIN
	-- update the table for STD_HL724EthnicityMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724EthnicityMapHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL724EthnicityMpHstry
after UPDATE
ON SDSADM.STD_HL724ETHNICITYMAPHISTORY
BEGIN
	-- update the table for STD_HL724EthnicityMapHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724EthnicityMapHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL724ETHNICITYMAPHISTORY FOR SDSADM.STD_HL724ETHNICITYMAPHISTORY;


ALTER TABLE SDSADM.STD_HL724ETHNICITYMAPHISTORY ADD (
  CONSTRAINT PK_STD_HL724ETHNICITYMAPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL724ETHNICITYMAPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL724ETHNICITYMAPHISTORY ADD (
  CONSTRAINT FKSTD_HL724ETHNCTYMPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HL724ETHNICITYMAP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL724ETHNICITYMAPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL724ETHNICITYMAPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL724ETHNICITYMAPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HL724ETHNICITYMAP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HL724ETHNICITYMAP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HL724ETHNICITYMAP
(
  ID            NUMBER(20)                      NOT NULL,
  HL7VALUE      VARCHAR2(8 BYTE)                NOT NULL,
  NAME          VARCHAR2(80 BYTE)               NOT NULL,
  ETHNICITY_ID  NUMBER(20)                      NOT NULL,
  DESCRIPTION   VARCHAR2(250 BYTE),
  VERSION       INTEGER                         NOT NULL,
  CREATED       TIMESTAMP(6)                    NOT NULL,
  UPDATED       TIMESTAMP(6),
  CREATEDBY     VARCHAR2(32 BYTE)               NOT NULL,
  UPDATEDBY     VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HL724ETHNICITYMAP ON SDSADM.STD_HL724ETHNICITYMAP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL724ETHNICITYMAPETHNCTY ON SDSADM.STD_HL724ETHNICITYMAP
(ETHNICITY_ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL724ETHNICITYMAPHL7VL ON SDSADM.STD_HL724ETHNICITYMAP
(HL7VALUE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HL724ETHNICITYMAPNAME ON SDSADM.STD_HL724ETHNICITYMAP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HL724EthnicityMap
after DELETE
ON SDSADM.STD_HL724ETHNICITYMAP
BEGIN
	-- update the table for STD_HL724EthnicityMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724EthnicityMap';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HL724EthnicityMap
after INSERT
ON SDSADM.STD_HL724ETHNICITYMAP
BEGIN
	-- update the table for STD_HL724EthnicityMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724EthnicityMap';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HL724EthnicityMap
after UPDATE
ON SDSADM.STD_HL724ETHNICITYMAP
BEGIN
	-- update the table for STD_HL724EthnicityMap operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HL724EthnicityMap';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HL724ETHNICITYMAP FOR SDSADM.STD_HL724ETHNICITYMAP;


ALTER TABLE SDSADM.STD_HL724ETHNICITYMAP ADD (
  CONSTRAINT PK_STD_HL724ETHNICITYMAP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HL724ETHNICITYMAP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL724ETHNICITYMAPETHNCTY
  UNIQUE (ETHNICITY_ID)
  USING INDEX SDSADM.UQSTD_HL724ETHNICITYMAPETHNCTY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL724ETHNICITYMAPHL7VL
  UNIQUE (HL7VALUE)
  USING INDEX SDSADM.UQSTD_HL724ETHNICITYMAPHL7VL
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HL724ETHNICITYMAPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HL724ETHNICITYMAPNAME
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HL724ETHNICITYMAP ADD (
  CONSTRAINT FKSTD_HL724ETHNICITYMAPETHNCTY 
  FOREIGN KEY (ETHNICITY_ID) 
  REFERENCES SDSADM.STD_ETHNICITY (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HL724ETHNICITYMAP TO ADR;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAP TO ADREXT;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAP TO EESRV;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HL724ETHNICITYMAP TO LOBR;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HL724ETHNICITYMAP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HL724ETHNICITYMAP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HEALTHBENEFITTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HEALTHBENEFITTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HEALTHBENEFITTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HEALTHBENEFITTYPEHSTRY ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HealthBenefitTypHstry
after DELETE
ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY
BEGIN
	-- update the table for STD_HealthBenefitTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HealthBenefitTypHstry
after INSERT
ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY
BEGIN
	-- update the table for STD_HealthBenefitTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HealthBenefitTypHstry
after UPDATE
ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY
BEGIN
	-- update the table for STD_HealthBenefitTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HEALTHBENEFITTYPEHISTORY FOR SDSADM.STD_HEALTHBENEFITTYPEHISTORY;


ALTER TABLE SDSADM.STD_HEALTHBENEFITTYPEHISTORY ADD (
  CONSTRAINT PK_STD_HEALTHBENEFITTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HEALTHBENEFITTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HEALTHBENEFITTYPEHISTORY ADD (
  CONSTRAINT FKSTD_HEALTHBNFTTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HEALTHBENEFITTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HEALTHBENEFITTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HEALTHBENEFITTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HEALTHBENEFITTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(200 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HEALTHBENEFITTYPE ON SDSADM.STD_HEALTHBENEFITTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HEALTHBENEFITTYPECODE ON SDSADM.STD_HEALTHBENEFITTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HEALTHBENEFITTYPENAME ON SDSADM.STD_HEALTHBENEFITTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_HealthBenefitType
after DELETE
ON SDSADM.STD_HEALTHBENEFITTYPE
BEGIN
	-- update the table for STD_HealthBenefitType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_HealthBenefitType
after INSERT
ON SDSADM.STD_HEALTHBENEFITTYPE
BEGIN
	-- update the table for STD_HealthBenefitType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_HealthBenefitType
after UPDATE
ON SDSADM.STD_HEALTHBENEFITTYPE
BEGIN
	-- update the table for STD_HealthBenefitType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HEALTHBENEFITTYPE FOR SDSADM.STD_HEALTHBENEFITTYPE;


ALTER TABLE SDSADM.STD_HEALTHBENEFITTYPE ADD (
  CONSTRAINT PK_STD_HEALTHBENEFITTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HEALTHBENEFITTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HEALTHBENEFITTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HEALTHBENEFITTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HEALTHBENEFITTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HEALTHBENEFITTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HEALTHBENEFITTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HEALTHBENEFITTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HEALTHBENEFITTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HEALTHBENEFITPLANHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HEALTHBENEFITPLANHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HEALTHBENEFITPLANHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HEALTHBENEFITPLANHSTRY ON SDSADM.STD_HEALTHBENEFITPLANHISTORY
(ID)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del5_STD_HealthBenefitPlanHist
after DELETE
ON SDSADM.STD_HEALTHBENEFITPLANHISTORY
BEGIN
	-- update the table for STD_HealthBenefitPlanHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitPlanHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins5_STD_HealthBenefitPlanHist
after INSERT
ON SDSADM.STD_HEALTHBENEFITPLANHISTORY
BEGIN
	-- update the table for STD_HealthBenefitPlanHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitPlanHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd5_STD_HealthBenefitPlanHist
after UPDATE
ON SDSADM.STD_HEALTHBENEFITPLANHISTORY
BEGIN
	-- update the table for STD_HealthBenefitPlanHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitPlanHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HEALTHBENEFITPLANHISTORY FOR SDSADM.STD_HEALTHBENEFITPLANHISTORY;


ALTER TABLE SDSADM.STD_HEALTHBENEFITPLANHISTORY ADD (
  CONSTRAINT PK_STD_HEALTHBENEFITPLANHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HEALTHBENEFITPLANHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_HEALTHBENEFITPLANHISTORY ADD (
  CONSTRAINT FKSTD_HEALTHBNFTPLNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_HEALTHBENEFITPLAN (ID)
  ON DELETE CASCADE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HEALTHBENEFITPLANHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLANHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLANHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLANHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HEALTHBENEFITPLANHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLANHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HEALTHBENEFITPLANHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLANHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLANHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_HEALTHBENEFITPLAN
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_HEALTHBENEFITPLAN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_HEALTHBENEFITPLAN
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(200 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(300 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_HEALTHBENEFITPLAN ON SDSADM.STD_HEALTHBENEFITPLAN
(ID)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HEALTHBENEFITPLANCODE ON SDSADM.STD_HEALTHBENEFITPLAN
(CODE)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_HEALTHBENEFITPLANNAME ON SDSADM.STD_HEALTHBENEFITPLAN
(NAME)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del5_STD_HealthBenefitPlan
after DELETE
ON SDSADM.STD_HEALTHBENEFITPLAN
BEGIN
	-- update the table for STD_HealthBenefitPlan operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitPlan';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins5_STD_HealthBenefitPlan
after INSERT
ON SDSADM.STD_HEALTHBENEFITPLAN
BEGIN
	-- update the table for STD_HealthBenefitPlan operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitPlan';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd5_STD_HealthBenefitPlan
after UPDATE
ON SDSADM.STD_HEALTHBENEFITPLAN
BEGIN
	-- update the table for STD_HealthBenefitPlan operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_HealthBenefitPlan';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_HEALTHBENEFITPLAN FOR SDSADM.STD_HEALTHBENEFITPLAN;


ALTER TABLE SDSADM.STD_HEALTHBENEFITPLAN ADD (
  CONSTRAINT PK_STD_HEALTHBENEFITPLAN
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_HEALTHBENEFITPLAN
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HEALTHBENEFITPLANCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_HEALTHBENEFITPLANCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_HEALTHBENEFITPLANNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_HEALTHBENEFITPLANNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_HEALTHBENEFITPLAN TO ADR;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLAN TO ADREXT;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLAN TO EESRV;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLAN TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_HEALTHBENEFITPLAN TO LOBR;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLAN TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_HEALTHBENEFITPLAN TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLAN TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_HEALTHBENEFITPLAN TO SDS_SELECT;
ALTER TABLE SDSADM.STD_GMTTHRESHOLDS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_GMTTHRESHOLDS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_GMTTHRESHOLDS
(
  ID             NUMBER(20)                     NOT NULL,
  EFFECTIVEYEAR  CHAR(4 BYTE)                   NOT NULL,
  STATENAME      VARCHAR2(50 BYTE)              NOT NULL,
  COUNTYNAME     VARCHAR2(50 BYTE)              NOT NULL,
  FIPS           CHAR(5 BYTE)                   NOT NULL,
  TRHD1          INTEGER                        NOT NULL,
  TRHD2          INTEGER                        NOT NULL,
  TRHD3          INTEGER                        NOT NULL,
  TRHD4          INTEGER                        NOT NULL,
  TRHD5          INTEGER                        NOT NULL,
  TRHD6          INTEGER                        NOT NULL,
  TRHD7          INTEGER                        NOT NULL,
  TRHD8          INTEGER                        NOT NULL,
  MSA            NUMBER(10)                     NOT NULL,
  MSANAME        VARCHAR2(40 BYTE),
  VERSION        INTEGER                        NOT NULL,
  CREATED        TIMESTAMP(6)                   NOT NULL,
  UPDATED        TIMESTAMP(6),
  CREATEDBY      VARCHAR2(32 BYTE)              NOT NULL,
  UPDATEDBY      VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_GMTTHRESHOLDS ON SDSADM.STD_GMTTHRESHOLDS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_GMTThresholds
after DELETE
ON SDSADM.STD_GMTTHRESHOLDS
BEGIN
	-- update the table for STD_GMTThresholds operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_GMTThresholds';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_GMTThresholds
after INSERT
ON SDSADM.STD_GMTTHRESHOLDS
BEGIN
	-- update the table for STD_GMTThresholds operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_GMTThresholds';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_GMTThresholds
after UPDATE
ON SDSADM.STD_GMTTHRESHOLDS
BEGIN
	-- update the table for STD_GMTThresholds operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_GMTThresholds';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_GMTTHRESHOLDS FOR SDSADM.STD_GMTTHRESHOLDS;


ALTER TABLE SDSADM.STD_GMTTHRESHOLDS ADD (
  CONSTRAINT PK_STD_GMTTHRESHOLDS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_GMTTHRESHOLDS
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_GMTTHRESHOLDS TO ADR;

GRANT SELECT ON SDSADM.STD_GMTTHRESHOLDS TO ADREXT;

GRANT SELECT ON SDSADM.STD_GMTTHRESHOLDS TO EESRV;

GRANT SELECT ON SDSADM.STD_GMTTHRESHOLDS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_GMTTHRESHOLDS TO LOBR;

GRANT SELECT ON SDSADM.STD_GMTTHRESHOLDS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_GMTTHRESHOLDS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_GMTTHRESHOLDS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_GMTTHRESHOLDS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_GENDERHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_GENDERHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_GENDERHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_GENDERHISTORY ON SDSADM.STD_GENDERHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_GenderHistory
after DELETE
ON SDSADM.STD_GENDERHISTORY
BEGIN
	-- update the table for STD_GenderHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_GenderHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_GenderHistory
after INSERT
ON SDSADM.STD_GENDERHISTORY
BEGIN
	-- update the table for STD_GenderHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_GenderHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_GenderHistory
after UPDATE
ON SDSADM.STD_GENDERHISTORY
BEGIN
	-- update the table for STD_GenderHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_GenderHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_GENDERHISTORY FOR SDSADM.STD_GENDERHISTORY;


ALTER TABLE SDSADM.STD_GENDERHISTORY ADD (
  CONSTRAINT PK_STD_GENDERHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_GENDERHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_GENDERHISTORY ADD (
  CONSTRAINT FKSTD_GENDERHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_GENDER (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_GENDERHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_GENDERHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_GENDERHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_GENDERHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_GENDERHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_GENDERHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_GENDERHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_GENDERHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_GENDERHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_GENDER
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_GENDER CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_GENDER
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(20 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_GENDER ON SDSADM.STD_GENDER
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_GENDERCODE ON SDSADM.STD_GENDER
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_GENDERNAME ON SDSADM.STD_GENDER
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Gender
after DELETE
ON SDSADM.STD_GENDER
BEGIN
	-- update the table for STD_Gender operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Gender';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Gender
after INSERT
ON SDSADM.STD_GENDER
BEGIN
	-- update the table for STD_Gender operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Gender';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Gender
after UPDATE
ON SDSADM.STD_GENDER
BEGIN
	-- update the table for STD_Gender operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Gender';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_GENDER FOR SDSADM.STD_GENDER;


ALTER TABLE SDSADM.STD_GENDER ADD (
  CONSTRAINT PK_STD_GENDER
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_GENDER
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_GENDERCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_GENDERCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_GENDERNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_GENDERNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_GENDER TO ADR;

GRANT SELECT ON SDSADM.STD_GENDER TO ADREXT;

GRANT SELECT ON SDSADM.STD_GENDER TO EESRV;

GRANT SELECT ON SDSADM.STD_GENDER TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_GENDER TO LOBR;

GRANT SELECT ON SDSADM.STD_GENDER TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_GENDER TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_GENDER TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_GENDER TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FTITRANSTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FTITRANSTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FTITRANSTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FTITRANSTYPEHISTORY ON SDSADM.STD_FTITRANSTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FTITransTypeHistory
after DELETE
ON SDSADM.STD_FTITRANSTYPEHISTORY
BEGIN
	-- update the table for STD_FTITransTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FTITransTypeHistory
after INSERT
ON SDSADM.STD_FTITRANSTYPEHISTORY
BEGIN
	-- update the table for STD_FTITransTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FTITransTypeHistory
after UPDATE
ON SDSADM.STD_FTITRANSTYPEHISTORY
BEGIN
	-- update the table for STD_FTITransTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FTITRANSTYPEHISTORY FOR SDSADM.STD_FTITRANSTYPEHISTORY;


ALTER TABLE SDSADM.STD_FTITRANSTYPEHISTORY ADD (
  CONSTRAINT PK_STD_FTITRANSTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FTITRANSTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_FTITRANSTYPEHISTORY ADD (
  CONSTRAINT FKSTD_FTITRANSTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_FTITRANSTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FTITRANSTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FTITRANSTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FTITRANSTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FTITRANSTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FTITRANSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FTITRANSTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(10 BYTE)                NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FTITRANSTYPE ON SDSADM.STD_FTITRANSTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FTITRANSTYPECODE ON SDSADM.STD_FTITRANSTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FTITRANSTYPENAME ON SDSADM.STD_FTITRANSTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FTITransType
after DELETE
ON SDSADM.STD_FTITRANSTYPE
BEGIN
	-- update the table for STD_FTITransType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FTITransType
after INSERT
ON SDSADM.STD_FTITRANSTYPE
BEGIN
	-- update the table for STD_FTITransType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FTITransType
after UPDATE
ON SDSADM.STD_FTITRANSTYPE
BEGIN
	-- update the table for STD_FTITransType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FTITRANSTYPE FOR SDSADM.STD_FTITRANSTYPE;


ALTER TABLE SDSADM.STD_FTITRANSTYPE ADD (
  CONSTRAINT PK_STD_FTITRANSTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FTITRANSTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FTITRANSTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_FTITRANSTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FTITRANSTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_FTITRANSTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FTITRANSTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FTITRANSTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FTITRANSTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FTITRANSTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FTITRANSSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FTITRANSSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FTITRANSSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FTITRANSSTATUSHISTORY ON SDSADM.STD_FTITRANSSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FTITransStatusHistory
after DELETE
ON SDSADM.STD_FTITRANSSTATUSHISTORY
BEGIN
	-- update the table for STD_FTITransStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FTITransStatusHistory
after INSERT
ON SDSADM.STD_FTITRANSSTATUSHISTORY
BEGIN
	-- update the table for STD_FTITransStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FTITransStatusHistory
after UPDATE
ON SDSADM.STD_FTITRANSSTATUSHISTORY
BEGIN
	-- update the table for STD_FTITransStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FTITRANSSTATUSHISTORY FOR SDSADM.STD_FTITRANSSTATUSHISTORY;


ALTER TABLE SDSADM.STD_FTITRANSSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_FTITRANSSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FTITRANSSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_FTITRANSSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_FTITRANSSTATUSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_FTITRANSSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FTITRANSSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FTITRANSSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FTITRANSSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FTITRANSSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FTITRANSSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FTITRANSSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FTITRANSSTATUS ON SDSADM.STD_FTITRANSSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FTITRANSSTATUSCODE ON SDSADM.STD_FTITRANSSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FTITRANSSTATUSNAME ON SDSADM.STD_FTITRANSSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FTITransStatus
after DELETE
ON SDSADM.STD_FTITRANSSTATUS
BEGIN
	-- update the table for STD_FTITransStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FTITransStatus
after INSERT
ON SDSADM.STD_FTITRANSSTATUS
BEGIN
	-- update the table for STD_FTITransStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FTITransStatus
after UPDATE
ON SDSADM.STD_FTITRANSSTATUS
BEGIN
	-- update the table for STD_FTITransStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FTITransStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FTITRANSSTATUS FOR SDSADM.STD_FTITRANSSTATUS;


ALTER TABLE SDSADM.STD_FTITRANSSTATUS ADD (
  CONSTRAINT PK_STD_FTITRANSSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FTITRANSSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FTITRANSSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_FTITRANSSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FTITRANSSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_FTITRANSSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FTITRANSSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FTITRANSSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FTITRANSSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FTITRANSSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FINANINFOSOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FINANINFOSOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FINANINFOSOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FINANINFOSOURCEHISTORY ON SDSADM.STD_FINANINFOSOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FinanInfoSourceHstry
after DELETE
ON SDSADM.STD_FINANINFOSOURCEHISTORY
BEGIN
	-- update the table for STD_FinanInfoSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinanInfoSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FinanInfoSourceHstry
after INSERT
ON SDSADM.STD_FINANINFOSOURCEHISTORY
BEGIN
	-- update the table for STD_FinanInfoSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinanInfoSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FinanInfoSourceHstry
after UPDATE
ON SDSADM.STD_FINANINFOSOURCEHISTORY
BEGIN
	-- update the table for STD_FinanInfoSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinanInfoSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FINANINFOSOURCEHISTORY FOR SDSADM.STD_FINANINFOSOURCEHISTORY;


ALTER TABLE SDSADM.STD_FINANINFOSOURCEHISTORY ADD (
  CONSTRAINT PK_STD_FINANINFOSOURCEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FINANINFOSOURCEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_FINANINFOSOURCEHISTORY ADD (
  CONSTRAINT FKSTD_FINANINFOSOURCEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_FINANINFOSOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FINANINFOSOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FINANINFOSOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FINANINFOSOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FINANINFOSOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FINANINFOSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FINANINFOSOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FINANINFOSOURCE ON SDSADM.STD_FINANINFOSOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FINANINFOSOURCECODE ON SDSADM.STD_FINANINFOSOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FINANINFOSOURCENAME ON SDSADM.STD_FINANINFOSOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FinanInfoSource
after DELETE
ON SDSADM.STD_FINANINFOSOURCE
BEGIN
	-- update the table for STD_FinanInfoSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinanInfoSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FinanInfoSource
after INSERT
ON SDSADM.STD_FINANINFOSOURCE
BEGIN
	-- update the table for STD_FinanInfoSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinanInfoSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FinanInfoSource
after UPDATE
ON SDSADM.STD_FINANINFOSOURCE
BEGIN
	-- update the table for STD_FinanInfoSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinanInfoSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FINANINFOSOURCE FOR SDSADM.STD_FINANINFOSOURCE;


ALTER TABLE SDSADM.STD_FINANINFOSOURCE ADD (
  CONSTRAINT PK_STD_FINANINFOSOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FINANINFOSOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FINANINFOSOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_FINANINFOSOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FINANINFOSOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_FINANINFOSOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FINANINFOSOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FINANINFOSOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FINANINFOSOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FINANINFOSOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FINANCIALMAPPINGHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FINANCIALMAPPINGHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FINANCIALMAPPINGHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FINANCIALMAPPINGHISTORY ON SDSADM.STD_FINANCIALMAPPINGHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FinancialMappingHstry
after DELETE
ON SDSADM.STD_FINANCIALMAPPINGHISTORY
BEGIN
	-- update the table for STD_FinancialMappingHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialMappingHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FinancialMappingHstry
after INSERT
ON SDSADM.STD_FINANCIALMAPPINGHISTORY
BEGIN
	-- update the table for STD_FinancialMappingHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialMappingHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FinancialMappingHstry
after UPDATE
ON SDSADM.STD_FINANCIALMAPPINGHISTORY
BEGIN
	-- update the table for STD_FinancialMappingHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialMappingHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FINANCIALMAPPINGHISTORY FOR SDSADM.STD_FINANCIALMAPPINGHISTORY;


ALTER TABLE SDSADM.STD_FINANCIALMAPPINGHISTORY ADD (
  CONSTRAINT PK_STD_FINANCIALMAPPINGHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FINANCIALMAPPINGHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_FINANCIALMAPPINGHISTORY ADD (
  CONSTRAINT FKSTD_FINANCIALMPPNGHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_FINANCIALMAPPING (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FINANCIALMAPPINGHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPINGHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPINGHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPINGHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FINANCIALMAPPINGHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPINGHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FINANCIALMAPPINGHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPINGHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPINGHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FINANCIALMAPPING
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FINANCIALMAPPING CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FINANCIALMAPPING
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(6 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FINANCIALMAPPING ON SDSADM.STD_FINANCIALMAPPING
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FINANCIALMAPPINGCODE ON SDSADM.STD_FINANCIALMAPPING
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FINANCIALMAPPINGNAME ON SDSADM.STD_FINANCIALMAPPING
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FinancialMapping
after DELETE
ON SDSADM.STD_FINANCIALMAPPING
BEGIN
	-- update the table for STD_FinancialMapping operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialMapping';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FinancialMapping
after INSERT
ON SDSADM.STD_FINANCIALMAPPING
BEGIN
	-- update the table for STD_FinancialMapping operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialMapping';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FinancialMapping
after UPDATE
ON SDSADM.STD_FINANCIALMAPPING
BEGIN
	-- update the table for STD_FinancialMapping operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialMapping';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FINANCIALMAPPING FOR SDSADM.STD_FINANCIALMAPPING;


ALTER TABLE SDSADM.STD_FINANCIALMAPPING ADD (
  CONSTRAINT PK_STD_FINANCIALMAPPING
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FINANCIALMAPPING
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FINANCIALMAPPINGCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_FINANCIALMAPPINGCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FINANCIALMAPPINGNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_FINANCIALMAPPINGNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FINANCIALMAPPING TO ADR;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPING TO ADREXT;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPING TO EESRV;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPING TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FINANCIALMAPPING TO LOBR;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPING TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FINANCIALMAPPING TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPING TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FINANCIALMAPPING TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FINANCIALDOCUMTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FINANCIALDOCUMTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FINANCIALDOCUMTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FINANCIALDOCUMTYPEHSTRY ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FinancialDcmTypHstry
after DELETE
ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY
BEGIN
	-- update the table for STD_FinancialDocumTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialDocumTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FinancialDcmTypHstry
after INSERT
ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY
BEGIN
	-- update the table for STD_FinancialDocumTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialDocumTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FinancialDcmTypHstry
after UPDATE
ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY
BEGIN
	-- update the table for STD_FinancialDocumTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialDocumTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FINANCIALDOCUMTYPEHISTORY FOR SDSADM.STD_FINANCIALDOCUMTYPEHISTORY;


ALTER TABLE SDSADM.STD_FINANCIALDOCUMTYPEHISTORY ADD (
  CONSTRAINT PK_STD_FINANCIALDOCUMTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FINANCIALDOCUMTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_FINANCIALDOCUMTYPEHISTORY ADD (
  CONSTRAINT FKSTD_FINANCIALDCMTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_FINANCIALDOCUMTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FINANCIALDOCUMTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FINANCIALDOCUMTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FINANCIALDOCUMTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FINANCIALDOCUMTYPE ON SDSADM.STD_FINANCIALDOCUMTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FINANCIALDOCUMTYPECODE ON SDSADM.STD_FINANCIALDOCUMTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FINANCIALDOCUMTYPENAME ON SDSADM.STD_FINANCIALDOCUMTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FinancialDocumType
after DELETE
ON SDSADM.STD_FINANCIALDOCUMTYPE
BEGIN
	-- update the table for STD_FinancialDocumType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialDocumType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FinancialDocumType
after INSERT
ON SDSADM.STD_FINANCIALDOCUMTYPE
BEGIN
	-- update the table for STD_FinancialDocumType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialDocumType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FinancialDocumType
after UPDATE
ON SDSADM.STD_FINANCIALDOCUMTYPE
BEGIN
	-- update the table for STD_FinancialDocumType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FinancialDocumType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FINANCIALDOCUMTYPE FOR SDSADM.STD_FINANCIALDOCUMTYPE;


ALTER TABLE SDSADM.STD_FINANCIALDOCUMTYPE ADD (
  CONSTRAINT PK_STD_FINANCIALDOCUMTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FINANCIALDOCUMTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FINANCIALDOCUMTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_FINANCIALDOCUMTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FINANCIALDOCUMTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_FINANCIALDOCUMTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FINANCIALDOCUMTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FINANCIALDOCUMTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FINANCIALDOCUMTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FINANCIALDOCUMTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FILIPINOVETPROOFHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FILIPINOVETPROOFHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FILIPINOVETPROOFHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FILIPINOVETPROOFHISTORY ON SDSADM.STD_FILIPINOVETPROOFHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FilipinoVetProofHstry
after DELETE
ON SDSADM.STD_FILIPINOVETPROOFHISTORY
BEGIN
	-- update the table for STD_FilipinoVetProofHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FilipinoVetProofHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FilipinoVetProofHstry
after INSERT
ON SDSADM.STD_FILIPINOVETPROOFHISTORY
BEGIN
	-- update the table for STD_FilipinoVetProofHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FilipinoVetProofHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FilipinoVetProofHstry
after UPDATE
ON SDSADM.STD_FILIPINOVETPROOFHISTORY
BEGIN
	-- update the table for STD_FilipinoVetProofHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FilipinoVetProofHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FILIPINOVETPROOFHISTORY FOR SDSADM.STD_FILIPINOVETPROOFHISTORY;


ALTER TABLE SDSADM.STD_FILIPINOVETPROOFHISTORY ADD (
  CONSTRAINT PK_STD_FILIPINOVETPROOFHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FILIPINOVETPROOFHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_FILIPINOVETPROOFHISTORY ADD (
  CONSTRAINT FKSTD_FILIPINOVETPRFHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_FILIPINOVETERANPROOF (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FILIPINOVETPROOFHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_FILIPINOVETPROOFHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_FILIPINOVETPROOFHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_FILIPINOVETPROOFHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FILIPINOVETPROOFHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_FILIPINOVETPROOFHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FILIPINOVETPROOFHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FILIPINOVETPROOFHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FILIPINOVETPROOFHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FILIPINOVETERANPROOF
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FILIPINOVETERANPROOF CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FILIPINOVETERANPROOF
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FILIPINOVETPROOF ON SDSADM.STD_FILIPINOVETERANPROOF
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FILIPINOVETPROOFCODE ON SDSADM.STD_FILIPINOVETERANPROOF
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FILIPINOVETPROOFNAME ON SDSADM.STD_FILIPINOVETERANPROOF
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FilipinoVetProof
after DELETE
ON SDSADM.STD_FILIPINOVETERANPROOF
BEGIN
	-- update the table for STD_FilipinoVeteranProof operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FilipinoVeteranProof';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FilipinoVetProof
after INSERT
ON SDSADM.STD_FILIPINOVETERANPROOF
BEGIN
	-- update the table for STD_FilipinoVeteranProof operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FilipinoVeteranProof';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FilipinoVetProof
after UPDATE
ON SDSADM.STD_FILIPINOVETERANPROOF
BEGIN
	-- update the table for STD_FilipinoVeteranProof operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FilipinoVeteranProof';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FILIPINOVETERANPROOF FOR SDSADM.STD_FILIPINOVETERANPROOF;


ALTER TABLE SDSADM.STD_FILIPINOVETERANPROOF ADD (
  CONSTRAINT PK_STD_FILIPINOVETPROOF
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FILIPINOVETPROOF
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FILIPINOVETPROOFCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_FILIPINOVETPROOFCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FILIPINOVETPROOFNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_FILIPINOVETPROOFNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FILIPINOVETERANPROOF TO ADR;

GRANT SELECT ON SDSADM.STD_FILIPINOVETERANPROOF TO ADREXT;

GRANT SELECT ON SDSADM.STD_FILIPINOVETERANPROOF TO EESRV;

GRANT SELECT ON SDSADM.STD_FILIPINOVETERANPROOF TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FILIPINOVETERANPROOF TO LOBR;

GRANT SELECT ON SDSADM.STD_FILIPINOVETERANPROOF TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FILIPINOVETERANPROOF TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FILIPINOVETERANPROOF TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FILIPINOVETERANPROOF TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FEEBASISTRTMNTHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FEEBASISTRTMNTHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FEEBASISTRTMNTHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FEEBASISTRTMNTHISTORY ON SDSADM.STD_FEEBASISTRTMNTHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FeeBasisTrtmntHistory
after DELETE
ON SDSADM.STD_FEEBASISTRTMNTHISTORY
BEGIN
	-- update the table for STD_FeeBasisTrtmntHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisTrtmntHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FeeBasisTrtmntHistory
after INSERT
ON SDSADM.STD_FEEBASISTRTMNTHISTORY
BEGIN
	-- update the table for STD_FeeBasisTrtmntHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisTrtmntHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FeeBasisTrtmntHistory
after UPDATE
ON SDSADM.STD_FEEBASISTRTMNTHISTORY
BEGIN
	-- update the table for STD_FeeBasisTrtmntHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisTrtmntHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FEEBASISTRTMNTHISTORY FOR SDSADM.STD_FEEBASISTRTMNTHISTORY;


ALTER TABLE SDSADM.STD_FEEBASISTRTMNTHISTORY ADD (
  CONSTRAINT PK_STD_FEEBASISTRTMNTHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FEEBASISTRTMNTHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_FEEBASISTRTMNTHISTORY ADD (
  CONSTRAINT FKSTD_FEEBASISTRTMNTHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_FEEBASISTREATMENTCODETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FEEBASISTRTMNTHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_FEEBASISTRTMNTHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_FEEBASISTRTMNTHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_FEEBASISTRTMNTHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FEEBASISTRTMNTHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_FEEBASISTRTMNTHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FEEBASISTRTMNTHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FEEBASISTRTMNTHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FEEBASISTRTMNTHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FEEBASISTREATMENTCODETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FEEBASISTREATMENTCODETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FEEBASISTREATMENTCODETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FEEBASISTRTMNT ON SDSADM.STD_FEEBASISTREATMENTCODETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FEEBASISTRTMNTCODE ON SDSADM.STD_FEEBASISTREATMENTCODETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FEEBASISTRTMNTNAME ON SDSADM.STD_FEEBASISTREATMENTCODETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FeeBasisTrtmnt
after DELETE
ON SDSADM.STD_FEEBASISTREATMENTCODETYPE
BEGIN
	-- update the table for STD_FeeBasisTreatmentCodeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisTreatmentCodeType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FeeBasisTrtmnt
after INSERT
ON SDSADM.STD_FEEBASISTREATMENTCODETYPE
BEGIN
	-- update the table for STD_FeeBasisTreatmentCodeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisTreatmentCodeType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FeeBasisTrtmnt
after UPDATE
ON SDSADM.STD_FEEBASISTREATMENTCODETYPE
BEGIN
	-- update the table for STD_FeeBasisTreatmentCodeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisTreatmentCodeType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FEEBASISTREATMENTCODETYPE FOR SDSADM.STD_FEEBASISTREATMENTCODETYPE;


ALTER TABLE SDSADM.STD_FEEBASISTREATMENTCODETYPE ADD (
  CONSTRAINT PK_STD_FEEBASISTRTMNT
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FEEBASISTRTMNT
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FEEBASISTRTMNTCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_FEEBASISTRTMNTCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FEEBASISTRTMNTNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_FEEBASISTRTMNTNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FEEBASISTREATMENTCODETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_FEEBASISTREATMENTCODETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_FEEBASISTREATMENTCODETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_FEEBASISTREATMENTCODETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FEEBASISTREATMENTCODETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_FEEBASISTREATMENTCODETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FEEBASISTREATMENTCODETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FEEBASISTREATMENTCODETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FEEBASISTREATMENTCODETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FEEBASISPROGRAM
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FEEBASISPROGRAM CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FEEBASISPROGRAM
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FEEBASISPRGRM ON SDSADM.STD_FEEBASISPROGRAM
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FEEBASISPRGRMCODE ON SDSADM.STD_FEEBASISPROGRAM
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FEEBASISPRGRMNAME ON SDSADM.STD_FEEBASISPROGRAM
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FeeBasisPrgrm
after DELETE
ON SDSADM.STD_FEEBASISPROGRAM
BEGIN
	-- update the table for STD_FeeBasisProgram operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisProgram';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FeeBasisPrgrm
after INSERT
ON SDSADM.STD_FEEBASISPROGRAM
BEGIN
	-- update the table for STD_FeeBasisProgram operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisProgram';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FeeBasisPrgrm
after UPDATE
ON SDSADM.STD_FEEBASISPROGRAM
BEGIN
	-- update the table for STD_FeeBasisProgram operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisProgram';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FEEBASISPROGRAM FOR SDSADM.STD_FEEBASISPROGRAM;


ALTER TABLE SDSADM.STD_FEEBASISPROGRAM ADD (
  CONSTRAINT PK_STD_FEEBASISPRGRM
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FEEBASISPRGRM
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FEEBASISPRGRMCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_FEEBASISPRGRMCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FEEBASISPRGRMNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_FEEBASISPRGRMNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FEEBASISPROGRAM TO ADR;

GRANT SELECT ON SDSADM.STD_FEEBASISPROGRAM TO ADREXT;

GRANT SELECT ON SDSADM.STD_FEEBASISPROGRAM TO EESRV;

GRANT SELECT ON SDSADM.STD_FEEBASISPROGRAM TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FEEBASISPROGRAM TO LOBR;

GRANT SELECT ON SDSADM.STD_FEEBASISPROGRAM TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FEEBASISPROGRAM TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FEEBASISPROGRAM TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FEEBASISPROGRAM TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FEEBASISPRGRMHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FEEBASISPRGRMHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FEEBASISPRGRMHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FEEBASISPRGRMHISTORY ON SDSADM.STD_FEEBASISPRGRMHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FeeBasisPrgrmHistory
after DELETE
ON SDSADM.STD_FEEBASISPRGRMHISTORY
BEGIN
	-- update the table for STD_FeeBasisPrgrmHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisPrgrmHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FeeBasisPrgrmHistory
after INSERT
ON SDSADM.STD_FEEBASISPRGRMHISTORY
BEGIN
	-- update the table for STD_FeeBasisPrgrmHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisPrgrmHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FeeBasisPrgrmHistory
after UPDATE
ON SDSADM.STD_FEEBASISPRGRMHISTORY
BEGIN
	-- update the table for STD_FeeBasisPrgrmHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FeeBasisPrgrmHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FEEBASISPRGRMHISTORY FOR SDSADM.STD_FEEBASISPRGRMHISTORY;


ALTER TABLE SDSADM.STD_FEEBASISPRGRMHISTORY ADD (
  CONSTRAINT PK_STD_FEEBASISPRGRMHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FEEBASISPRGRMHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_FEEBASISPRGRMHISTORY ADD (
  CONSTRAINT FKSTD_FEEBASISPRGRMHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_FEEBASISPROGRAM (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FEEBASISPRGRMHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_FEEBASISPRGRMHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_FEEBASISPRGRMHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_FEEBASISPRGRMHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FEEBASISPRGRMHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_FEEBASISPRGRMHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FEEBASISPRGRMHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FEEBASISPRGRMHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FEEBASISPRGRMHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FACILITYTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FACILITYTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FACILITYTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FACILITYTYPEHISTORY ON SDSADM.STD_FACILITYTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FacilityTypeHistory
after DELETE
ON SDSADM.STD_FACILITYTYPEHISTORY
BEGIN
	-- update the table for STD_FacilityTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FacilityTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FacilityTypeHistory
after INSERT
ON SDSADM.STD_FACILITYTYPEHISTORY
BEGIN
	-- update the table for STD_FacilityTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FacilityTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FacilityTypeHistory
after UPDATE
ON SDSADM.STD_FACILITYTYPEHISTORY
BEGIN
	-- update the table for STD_FacilityTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FacilityTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FACILITYTYPEHISTORY FOR SDSADM.STD_FACILITYTYPEHISTORY;


ALTER TABLE SDSADM.STD_FACILITYTYPEHISTORY ADD (
  CONSTRAINT PK_STD_FACILITYTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FACILITYTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_FACILITYTYPEHISTORY ADD (
  CONSTRAINT FKSTD_FACILITYTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_FACILITYTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FACILITYTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_FACILITYTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_FACILITYTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_FACILITYTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FACILITYTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_FACILITYTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FACILITYTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FACILITYTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FACILITYTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_FACILITYTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_FACILITYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_FACILITYTYPE
(
  ID                 NUMBER(20)                 NOT NULL,
  CODE               VARCHAR2(11 BYTE)          NOT NULL,
  NAME               VARCHAR2(45 BYTE)          NOT NULL,
  DESCRIPTION        VARCHAR2(60 BYTE),
  ISMEDICALTREATING  CHAR(1 BYTE),
  VERSION            INTEGER                    NOT NULL,
  CREATED            TIMESTAMP(6)               NOT NULL,
  UPDATED            TIMESTAMP(6),
  CREATEDBY          VARCHAR2(32 BYTE)          NOT NULL,
  UPDATEDBY          VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_FACILITYTYPE ON SDSADM.STD_FACILITYTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FACILITYTYPECODE ON SDSADM.STD_FACILITYTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_FACILITYTYPENAME ON SDSADM.STD_FACILITYTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_FacilityType
after DELETE
ON SDSADM.STD_FACILITYTYPE
BEGIN
	-- update the table for STD_FacilityType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FacilityType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_FacilityType
after INSERT
ON SDSADM.STD_FACILITYTYPE
BEGIN
	-- update the table for STD_FacilityType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FacilityType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_FacilityType
after UPDATE
ON SDSADM.STD_FACILITYTYPE
BEGIN
	-- update the table for STD_FacilityType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_FacilityType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_FACILITYTYPE FOR SDSADM.STD_FACILITYTYPE;


ALTER TABLE SDSADM.STD_FACILITYTYPE ADD (
  CONSTRAINT PK_STD_FACILITYTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_FACILITYTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FACILITYTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_FACILITYTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_FACILITYTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_FACILITYTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_FACILITYTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_FACILITYTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_FACILITYTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_FACILITYTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_FACILITYTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_FACILITYTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_FACILITYTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_FACILITYTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_FACILITYTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EXTREMITYCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EXTREMITYCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EXTREMITYCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EXTREMITYCODEHISTORY ON SDSADM.STD_EXTREMITYCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ExtremityCodeHistory
after DELETE
ON SDSADM.STD_EXTREMITYCODEHISTORY
BEGIN
	-- update the table for STD_ExtremityCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExtremityCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ExtremityCodeHistory
after INSERT
ON SDSADM.STD_EXTREMITYCODEHISTORY
BEGIN
	-- update the table for STD_ExtremityCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExtremityCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ExtremityCodeHistory
after UPDATE
ON SDSADM.STD_EXTREMITYCODEHISTORY
BEGIN
	-- update the table for STD_ExtremityCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExtremityCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EXTREMITYCODEHISTORY FOR SDSADM.STD_EXTREMITYCODEHISTORY;


ALTER TABLE SDSADM.STD_EXTREMITYCODEHISTORY ADD (
  CONSTRAINT PK_STD_EXTREMITYCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EXTREMITYCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EXTREMITYCODEHISTORY ADD (
  CONSTRAINT FKSTD_EXTREMITYCODEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EXTREMITYCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EXTREMITYCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EXTREMITYCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EXTREMITYCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EXTREMITYCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EXTREMITYCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EXTREMITYCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EXTREMITYCODE ON SDSADM.STD_EXTREMITYCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EXTREMITYCODECODE ON SDSADM.STD_EXTREMITYCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EXTREMITYCODENAME ON SDSADM.STD_EXTREMITYCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ExtremityCode
after DELETE
ON SDSADM.STD_EXTREMITYCODE
BEGIN
	-- update the table for STD_ExtremityCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExtremityCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ExtremityCode
after INSERT
ON SDSADM.STD_EXTREMITYCODE
BEGIN
	-- update the table for STD_ExtremityCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExtremityCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ExtremityCode
after UPDATE
ON SDSADM.STD_EXTREMITYCODE
BEGIN
	-- update the table for STD_ExtremityCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExtremityCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EXTREMITYCODE FOR SDSADM.STD_EXTREMITYCODE;


ALTER TABLE SDSADM.STD_EXTREMITYCODE ADD (
  CONSTRAINT PK_STD_EXTREMITYCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EXTREMITYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EXTREMITYCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EXTREMITYCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EXTREMITYCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EXTREMITYCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EXTREMITYCODE TO ADR;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EXTREMITYCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EXTREMITYCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EXTREMITYCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EXPENSETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EXPENSETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EXPENSETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EXPENSETYPEHISTORY ON SDSADM.STD_EXPENSETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ExpenseTypeHistory
after DELETE
ON SDSADM.STD_EXPENSETYPEHISTORY
BEGIN
	-- update the table for STD_ExpenseTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExpenseTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ExpenseTypeHistory
after INSERT
ON SDSADM.STD_EXPENSETYPEHISTORY
BEGIN
	-- update the table for STD_ExpenseTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExpenseTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ExpenseTypeHistory
after UPDATE
ON SDSADM.STD_EXPENSETYPEHISTORY
BEGIN
	-- update the table for STD_ExpenseTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExpenseTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EXPENSETYPEHISTORY FOR SDSADM.STD_EXPENSETYPEHISTORY;


ALTER TABLE SDSADM.STD_EXPENSETYPEHISTORY ADD (
  CONSTRAINT PK_STD_EXPENSETYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EXPENSETYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EXPENSETYPEHISTORY ADD (
  CONSTRAINT FKSTD_EXPENSETYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EXPENSETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EXPENSETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EXPENSETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EXPENSETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EXPENSETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EXPENSETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EXPENSETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EXPENSETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EXPENSETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EXPENSETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EXPENSETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EXPENSETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EXPENSETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10),
  NAME         VARCHAR2(40 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(2000 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EXPENSETYPE ON SDSADM.STD_EXPENSETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EXPENSETYPECODE ON SDSADM.STD_EXPENSETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EXPENSETYPENAME ON SDSADM.STD_EXPENSETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ExpenseType
after DELETE
ON SDSADM.STD_EXPENSETYPE
BEGIN
	-- update the table for STD_ExpenseType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExpenseType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ExpenseType
after INSERT
ON SDSADM.STD_EXPENSETYPE
BEGIN
	-- update the table for STD_ExpenseType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExpenseType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ExpenseType
after UPDATE
ON SDSADM.STD_EXPENSETYPE
BEGIN
	-- update the table for STD_ExpenseType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExpenseType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EXPENSETYPE FOR SDSADM.STD_EXPENSETYPE;


ALTER TABLE SDSADM.STD_EXPENSETYPE ADD (
  CONSTRAINT PK_STD_EXPENSETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EXPENSETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EXPENSETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EXPENSETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EXPENSETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EXPENSETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EXPENSETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_EXPENSETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_EXPENSETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_EXPENSETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EXPENSETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_EXPENSETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EXPENSETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EXPENSETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EXPENSETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EXCLUSIONRSNTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EXCLUSIONRSNTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EXCLUSIONRSNTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EXCLUSIONRSNTYPEHISTORY ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ExclusionRsnTypeHstry
after DELETE
ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY
BEGIN
	-- update the table for STD_ExclusionRsnTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExclusionRsnTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ExclusionRsnTypeHstry
after INSERT
ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY
BEGIN
	-- update the table for STD_ExclusionRsnTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExclusionRsnTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ExclusionRsnTypeHstry
after UPDATE
ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY
BEGIN
	-- update the table for STD_ExclusionRsnTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExclusionRsnTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EXCLUSIONRSNTYPEHISTORY FOR SDSADM.STD_EXCLUSIONRSNTYPEHISTORY;


ALTER TABLE SDSADM.STD_EXCLUSIONRSNTYPEHISTORY ADD (
  CONSTRAINT PK_STD_EXCLUSIONRSNTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EXCLUSIONRSNTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EXCLUSIONRSNTYPEHISTORY ADD (
  CONSTRAINT FKSTD_EXCLUSIONRSNTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EXCLUSIONRSNTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EXCLUSIONRSNTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EXCLUSIONRSNTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EXCLUSIONRSNTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EXCLUSIONRSNTYPE ON SDSADM.STD_EXCLUSIONRSNTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EXCLUSIONRSNTYPECODE ON SDSADM.STD_EXCLUSIONRSNTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EXCLUSIONRSNTYPENAME ON SDSADM.STD_EXCLUSIONRSNTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ExclusionRsnType
after DELETE
ON SDSADM.STD_EXCLUSIONRSNTYPE
BEGIN
	-- update the table for STD_ExclusionRsnType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExclusionRsnType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ExclusionRsnType
after INSERT
ON SDSADM.STD_EXCLUSIONRSNTYPE
BEGIN
	-- update the table for STD_ExclusionRsnType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExclusionRsnType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ExclusionRsnType
after UPDATE
ON SDSADM.STD_EXCLUSIONRSNTYPE
BEGIN
	-- update the table for STD_ExclusionRsnType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ExclusionRsnType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EXCLUSIONRSNTYPE FOR SDSADM.STD_EXCLUSIONRSNTYPE;


ALTER TABLE SDSADM.STD_EXCLUSIONRSNTYPE ADD (
  CONSTRAINT PK_STD_EXCLUSIONRSNTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EXCLUSIONRSNTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EXCLUSIONRSNTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EXCLUSIONRSNTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EXCLUSIONRSNTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EXCLUSIONRSNTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EXCLUSIONRSNTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EXCLUSIONRSNTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EXCLUSIONRSNTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EXCLUSIONRSNTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EVALUATIONMETHODHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EVALUATIONMETHODHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EVALUATIONMETHODHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EVALUATIONMETHODHISTORY ON SDSADM.STD_EVALUATIONMETHODHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EvaluationMethodHstry
after DELETE
ON SDSADM.STD_EVALUATIONMETHODHISTORY
BEGIN
	-- update the table for STD_EvaluationMethodHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EvaluationMethodHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EvaluationMethodHstry
after INSERT
ON SDSADM.STD_EVALUATIONMETHODHISTORY
BEGIN
	-- update the table for STD_EvaluationMethodHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EvaluationMethodHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EvaluationMethodHstry
after UPDATE
ON SDSADM.STD_EVALUATIONMETHODHISTORY
BEGIN
	-- update the table for STD_EvaluationMethodHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EvaluationMethodHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EVALUATIONMETHODHISTORY FOR SDSADM.STD_EVALUATIONMETHODHISTORY;


ALTER TABLE SDSADM.STD_EVALUATIONMETHODHISTORY ADD (
  CONSTRAINT PK_STD_EVALUATIONMETHODHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EVALUATIONMETHODHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EVALUATIONMETHODHISTORY ADD (
  CONSTRAINT FKSTD_EVALUATIONMTHDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EVALUATIONMETHOD (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EVALUATIONMETHODHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHODHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHODHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHODHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EVALUATIONMETHODHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHODHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EVALUATIONMETHODHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHODHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHODHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EVALUATIONMETHOD
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EVALUATIONMETHOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EVALUATIONMETHOD
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EVALUATIONMETHOD ON SDSADM.STD_EVALUATIONMETHOD
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EVALUATIONMETHODCODE ON SDSADM.STD_EVALUATIONMETHOD
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EVALUATIONMETHODNAME ON SDSADM.STD_EVALUATIONMETHOD
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EvaluationMethod
after DELETE
ON SDSADM.STD_EVALUATIONMETHOD
BEGIN
	-- update the table for STD_EvaluationMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EvaluationMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EvaluationMethod
after INSERT
ON SDSADM.STD_EVALUATIONMETHOD
BEGIN
	-- update the table for STD_EvaluationMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EvaluationMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EvaluationMethod
after UPDATE
ON SDSADM.STD_EVALUATIONMETHOD
BEGIN
	-- update the table for STD_EvaluationMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EvaluationMethod';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EVALUATIONMETHOD FOR SDSADM.STD_EVALUATIONMETHOD;


ALTER TABLE SDSADM.STD_EVALUATIONMETHOD ADD (
  CONSTRAINT PK_STD_EVALUATIONMETHOD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EVALUATIONMETHOD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EVALUATIONMETHODCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EVALUATIONMETHODCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EVALUATIONMETHODNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EVALUATIONMETHODNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EVALUATIONMETHOD TO ADR;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHOD TO ADREXT;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHOD TO EESRV;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHOD TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EVALUATIONMETHOD TO LOBR;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHOD TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EVALUATIONMETHOD TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHOD TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EVALUATIONMETHOD TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ETHNICITYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ETHNICITYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ETHNICITYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ETHNICITYHISTORY ON SDSADM.STD_ETHNICITYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EthnicityHistory
after DELETE
ON SDSADM.STD_ETHNICITYHISTORY
BEGIN
	-- update the table for STD_EthnicityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EthnicityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EthnicityHistory
after INSERT
ON SDSADM.STD_ETHNICITYHISTORY
BEGIN
	-- update the table for STD_EthnicityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EthnicityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EthnicityHistory
after UPDATE
ON SDSADM.STD_ETHNICITYHISTORY
BEGIN
	-- update the table for STD_EthnicityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EthnicityHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ETHNICITYHISTORY FOR SDSADM.STD_ETHNICITYHISTORY;


ALTER TABLE SDSADM.STD_ETHNICITYHISTORY ADD (
  CONSTRAINT PK_STD_ETHNICITYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ETHNICITYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ETHNICITYHISTORY ADD (
  CONSTRAINT FKSTD_ETHNICITYHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ETHNICITY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ETHNICITYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ETHNICITYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ETHNICITYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ETHNICITYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ETHNICITYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ETHNICITYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ETHNICITYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ETHNICITYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ETHNICITYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ETHNICITYCOLLECTIONMETHOD
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ETHNICITYCOLLECTIONMETHOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ETHNICITYCOLLECTIONMETHOD
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ETHCOLLMTHD ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ETHCOLLMTHDCODE ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ETHCOLLMTHDNAME ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EthCollMthd
after DELETE
ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD
BEGIN
	-- update the table for STD_EthnicityCollectionMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EthnicityCollectionMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EthCollMthd
after INSERT
ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD
BEGIN
	-- update the table for STD_EthnicityCollectionMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EthnicityCollectionMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EthCollMthd
after UPDATE
ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD
BEGIN
	-- update the table for STD_EthnicityCollectionMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EthnicityCollectionMethod';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ETHNICITYCOLLECTIONMETHOD FOR SDSADM.STD_ETHNICITYCOLLECTIONMETHOD;


ALTER TABLE SDSADM.STD_ETHNICITYCOLLECTIONMETHOD ADD (
  CONSTRAINT PK_STD_ETHCOLLMTHD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ETHCOLLMTHD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ETHCOLLMTHDCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ETHCOLLMTHDCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ETHCOLLMTHDNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ETHCOLLMTHDNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD TO ADR;

GRANT SELECT ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD TO ADREXT;

GRANT SELECT ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD TO EESRV;

GRANT SELECT ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD TO LOBR;

GRANT SELECT ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ETHNICITYCOLLECTIONMETHOD TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ETHNICITY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ETHNICITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ETHNICITY
(
  ID            NUMBER(20)                      NOT NULL,
  ABBREVIATION  VARCHAR2(5 BYTE)                NOT NULL,
  NAME          VARCHAR2(30 BYTE)               NOT NULL,
  DESCRIPTION   VARCHAR2(60 BYTE),
  HL7VALUE      VARCHAR2(10 BYTE),
  CDCVALUE      VARCHAR2(6 BYTE),
  PTFVALUE      CHAR(1 BYTE),
  VERSION       INTEGER                         NOT NULL,
  CREATED       TIMESTAMP(6)                    NOT NULL,
  UPDATED       TIMESTAMP(6),
  CREATEDBY     VARCHAR2(32 BYTE)               NOT NULL,
  UPDATEDBY     VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ETHNICITY ON SDSADM.STD_ETHNICITY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ETHNICITYABBREVIATION ON SDSADM.STD_ETHNICITY
(ABBREVIATION)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ETHNICITYCDCVALUE ON SDSADM.STD_ETHNICITY
(CDCVALUE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ETHNICITYHL7VALUE ON SDSADM.STD_ETHNICITY
(HL7VALUE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ETHNICITYNAME ON SDSADM.STD_ETHNICITY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ETHNICITYPTFVALUE ON SDSADM.STD_ETHNICITY
(PTFVALUE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Ethnicity
after DELETE
ON SDSADM.STD_ETHNICITY
BEGIN
	-- update the table for STD_Ethnicity operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Ethnicity';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Ethnicity
after INSERT
ON SDSADM.STD_ETHNICITY
BEGIN
	-- update the table for STD_Ethnicity operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Ethnicity';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Ethnicity
after UPDATE
ON SDSADM.STD_ETHNICITY
BEGIN
	-- update the table for STD_Ethnicity operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Ethnicity';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ETHNICITY FOR SDSADM.STD_ETHNICITY;


ALTER TABLE SDSADM.STD_ETHNICITY ADD (
  CONSTRAINT PK_STD_ETHNICITY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ETHNICITY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ETHNICITYABBREVIATION
  UNIQUE (ABBREVIATION)
  USING INDEX SDSADM.UQSTD_ETHNICITYABBREVIATION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ETHNICITYCDCVALUE
  UNIQUE (CDCVALUE)
  USING INDEX SDSADM.UQSTD_ETHNICITYCDCVALUE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ETHNICITYHL7VALUE
  UNIQUE (HL7VALUE)
  USING INDEX SDSADM.UQSTD_ETHNICITYHL7VALUE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ETHNICITYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ETHNICITYNAME
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ETHNICITYPTFVALUE
  UNIQUE (PTFVALUE)
  USING INDEX SDSADM.UQSTD_ETHNICITYPTFVALUE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ETHNICITY TO ADR;

GRANT SELECT ON SDSADM.STD_ETHNICITY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ETHNICITY TO EESRV;

GRANT SELECT ON SDSADM.STD_ETHNICITY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ETHNICITY TO LOBR;

GRANT REFERENCES, SELECT ON SDSADM.STD_ETHNICITY TO PATS;

GRANT REFERENCES, SELECT ON SDSADM.STD_ETHNICITY TO PATSRPTS;

GRANT SELECT ON SDSADM.STD_ETHNICITY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ETHNICITY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ETHNICITY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ETHNICITY TO SDS_SELECT;

GRANT SELECT ON SDSADM.STD_ETHNICITY TO TIER_PATS_ROLE;

GRANT SELECT ON SDSADM.STD_ETHNICITY TO TIER_SDSADM_ROLE;
ALTER TABLE SDSADM.STD_ETHCOLLMTHDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ETHCOLLMTHDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ETHCOLLMTHDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ETHCOLLMTHDHISTORY ON SDSADM.STD_ETHCOLLMTHDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EthCollMthdHistory
after DELETE
ON SDSADM.STD_ETHCOLLMTHDHISTORY
BEGIN
	-- update the table for STD_EthCollMthdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EthCollMthdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EthCollMthdHistory
after INSERT
ON SDSADM.STD_ETHCOLLMTHDHISTORY
BEGIN
	-- update the table for STD_EthCollMthdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EthCollMthdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EthCollMthdHistory
after UPDATE
ON SDSADM.STD_ETHCOLLMTHDHISTORY
BEGIN
	-- update the table for STD_EthCollMthdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EthCollMthdHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ETHCOLLMTHDHISTORY FOR SDSADM.STD_ETHCOLLMTHDHISTORY;


ALTER TABLE SDSADM.STD_ETHCOLLMTHDHISTORY ADD (
  CONSTRAINT PK_STD_ETHCOLLMTHDHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ETHCOLLMTHDHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ETHCOLLMTHDHISTORY ADD (
  CONSTRAINT FKSTD_ETHCOLLMTHDHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ETHNICITYCOLLECTIONMETHOD (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ETHCOLLMTHDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ETHCOLLMTHDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ETHCOLLMTHDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ETHCOLLMTHDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ETHCOLLMTHDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ETHCOLLMTHDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ETHCOLLMTHDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ETHCOLLMTHDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ETHCOLLMTHDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENTITLEMENTCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENTITLEMENTCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENTITLEMENTCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENTITLEMENTCODEHISTORY ON SDSADM.STD_ENTITLEMENTCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EntitlementCodeHstry
after DELETE
ON SDSADM.STD_ENTITLEMENTCODEHISTORY
BEGIN
	-- update the table for STD_EntitlementCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EntitlementCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EntitlementCodeHstry
after INSERT
ON SDSADM.STD_ENTITLEMENTCODEHISTORY
BEGIN
	-- update the table for STD_EntitlementCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EntitlementCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EntitlementCodeHstry
after UPDATE
ON SDSADM.STD_ENTITLEMENTCODEHISTORY
BEGIN
	-- update the table for STD_EntitlementCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EntitlementCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENTITLEMENTCODEHISTORY FOR SDSADM.STD_ENTITLEMENTCODEHISTORY;


ALTER TABLE SDSADM.STD_ENTITLEMENTCODEHISTORY ADD (
  CONSTRAINT PK_STD_ENTITLEMENTCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENTITLEMENTCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ENTITLEMENTCODEHISTORY ADD (
  CONSTRAINT FKSTD_ENTITLEMENTCODEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ENTITLEMENTCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENTITLEMENTCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENTITLEMENTCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENTITLEMENTCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENTITLEMENTCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENTITLEMENTCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENTITLEMENTCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENTITLEMENTCODE ON SDSADM.STD_ENTITLEMENTCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENTITLEMENTCODECODE ON SDSADM.STD_ENTITLEMENTCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENTITLEMENTCODENAME ON SDSADM.STD_ENTITLEMENTCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EntitlementCode
after DELETE
ON SDSADM.STD_ENTITLEMENTCODE
BEGIN
	-- update the table for STD_EntitlementCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EntitlementCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EntitlementCode
after INSERT
ON SDSADM.STD_ENTITLEMENTCODE
BEGIN
	-- update the table for STD_EntitlementCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EntitlementCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EntitlementCode
after UPDATE
ON SDSADM.STD_ENTITLEMENTCODE
BEGIN
	-- update the table for STD_EntitlementCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EntitlementCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENTITLEMENTCODE FOR SDSADM.STD_ENTITLEMENTCODE;


ALTER TABLE SDSADM.STD_ENTITLEMENTCODE ADD (
  CONSTRAINT PK_STD_ENTITLEMENTCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENTITLEMENTCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENTITLEMENTCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ENTITLEMENTCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENTITLEMENTCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ENTITLEMENTCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENTITLEMENTCODE TO ADR;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENTITLEMENTCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENTITLEMENTCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENTITLEMENTCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTSTATUSHISTORY ON SDSADM.STD_ENROLLMENTSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentStatusHstry
after DELETE
ON SDSADM.STD_ENROLLMENTSTATUSHISTORY
BEGIN
	-- update the table for STD_EnrollmentStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentStatusHstry
after INSERT
ON SDSADM.STD_ENROLLMENTSTATUSHISTORY
BEGIN
	-- update the table for STD_EnrollmentStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentStatusHstry
after UPDATE
ON SDSADM.STD_ENROLLMENTSTATUSHISTORY
BEGIN
	-- update the table for STD_EnrollmentStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTSTATUSHISTORY FOR SDSADM.STD_ENROLLMENTSTATUSHISTORY;


ALTER TABLE SDSADM.STD_ENROLLMENTSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_ENROLLMENTSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ENROLLMENTSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_ENROLLMENTSTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ENROLLMENTSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTSTATUS
(
  ID                NUMBER(20)                  NOT NULL,
  CODE              NUMBER(10)                  NOT NULL,
  NAME              VARCHAR2(50 BYTE)           NOT NULL,
  ENROLLMENTCAT_ID  NUMBER(20)                  NOT NULL,
  DESCRIPTION       VARCHAR2(100 BYTE),
  VERSION           INTEGER                     NOT NULL,
  CREATED           TIMESTAMP(6)                NOT NULL,
  UPDATED           TIMESTAMP(6),
  CREATEDBY         VARCHAR2(32 BYTE)           NOT NULL,
  UPDATEDBY         VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTSTATUS ON SDSADM.STD_ENROLLMENTSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTSTATUSCODE ON SDSADM.STD_ENROLLMENTSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTSTATUSNAME ON SDSADM.STD_ENROLLMENTSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentStatus
after DELETE
ON SDSADM.STD_ENROLLMENTSTATUS
BEGIN
	-- update the table for STD_EnrollmentStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentStatus
after INSERT
ON SDSADM.STD_ENROLLMENTSTATUS
BEGIN
	-- update the table for STD_EnrollmentStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentStatus
after UPDATE
ON SDSADM.STD_ENROLLMENTSTATUS
BEGIN
	-- update the table for STD_EnrollmentStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTSTATUS FOR SDSADM.STD_ENROLLMENTSTATUS;


ALTER TABLE SDSADM.STD_ENROLLMENTSTATUS ADD (
  CONSTRAINT PK_STD_ENROLLMENTSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ENROLLMENTSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ENROLLMENTSTATUSNAME
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ENROLLMENTSTATUS ADD (
  CONSTRAINT FKSTD_ENROLLMENTSTTSENRLLMNTCT 
  FOREIGN KEY (ENROLLMENTCAT_ID) 
  REFERENCES SDSADM.STD_ENROLLMENTCATTYPE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTSOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTSOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTSOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTSOURCEHISTORY ON SDSADM.STD_ENROLLMENTSOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentSourceHstry
after DELETE
ON SDSADM.STD_ENROLLMENTSOURCEHISTORY
BEGIN
	-- update the table for STD_EnrollmentSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentSourceHstry
after INSERT
ON SDSADM.STD_ENROLLMENTSOURCEHISTORY
BEGIN
	-- update the table for STD_EnrollmentSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentSourceHstry
after UPDATE
ON SDSADM.STD_ENROLLMENTSOURCEHISTORY
BEGIN
	-- update the table for STD_EnrollmentSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTSOURCEHISTORY FOR SDSADM.STD_ENROLLMENTSOURCEHISTORY;


ALTER TABLE SDSADM.STD_ENROLLMENTSOURCEHISTORY ADD (
  CONSTRAINT PK_STD_ENROLLMENTSOURCEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTSOURCEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ENROLLMENTSOURCEHISTORY ADD (
  CONSTRAINT FKSTD_ENROLLMENTSRCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ENROLLMENTSOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTSOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTSOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTSOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTSOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTSOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTSOURCE ON SDSADM.STD_ENROLLMENTSOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTSOURCECODE ON SDSADM.STD_ENROLLMENTSOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTSOURCENAME ON SDSADM.STD_ENROLLMENTSOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentSource
after DELETE
ON SDSADM.STD_ENROLLMENTSOURCE
BEGIN
	-- update the table for STD_EnrollmentSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentSource
after INSERT
ON SDSADM.STD_ENROLLMENTSOURCE
BEGIN
	-- update the table for STD_EnrollmentSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentSource
after UPDATE
ON SDSADM.STD_ENROLLMENTSOURCE
BEGIN
	-- update the table for STD_EnrollmentSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTSOURCE FOR SDSADM.STD_ENROLLMENTSOURCE;


ALTER TABLE SDSADM.STD_ENROLLMENTSOURCE ADD (
  CONSTRAINT PK_STD_ENROLLMENTSOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTSOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTSOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ENROLLMENTSOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTSOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ENROLLMENTSOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTSOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTSOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTSOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTSOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTPRRSGRPHSTRY ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrllmntPrrSGrpHstry
after DELETE
ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY
BEGIN
	-- update the table for STD_EnrollmentPriorSGrpHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorSGrpHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrllmntPrrSGrpHstry
after INSERT
ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY
BEGIN
	-- update the table for STD_EnrollmentPriorSGrpHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorSGrpHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrllmntPrrSGrpHstry
after UPDATE
ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY
BEGIN
	-- update the table for STD_EnrollmentPriorSGrpHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorSGrpHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTPRIORSGRPHISTORY FOR SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY;


ALTER TABLE SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY ADD (
  CONSTRAINT PK_STD_ENROLLMENTPRRSGRPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTPRRSGRPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY ADD (
  CONSTRAINT FKSTD_ENRLLMNTPRRSGRPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ENROLLMENTPRIORSGRP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTPRIORSGRP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTPRIORSGRP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTPRIORSGRP
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTPRIORSGRP ON SDSADM.STD_ENROLLMENTPRIORSGRP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTPRIORSGRPCODE ON SDSADM.STD_ENROLLMENTPRIORSGRP
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTPRIORSGRPNAME ON SDSADM.STD_ENROLLMENTPRIORSGRP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentPriorSGrp
after DELETE
ON SDSADM.STD_ENROLLMENTPRIORSGRP
BEGIN
	-- update the table for STD_EnrollmentPriorSGrp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorSGrp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentPriorSGrp
after INSERT
ON SDSADM.STD_ENROLLMENTPRIORSGRP
BEGIN
	-- update the table for STD_EnrollmentPriorSGrp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorSGrp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentPriorSGrp
after UPDATE
ON SDSADM.STD_ENROLLMENTPRIORSGRP
BEGIN
	-- update the table for STD_EnrollmentPriorSGrp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorSGrp';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTPRIORSGRP FOR SDSADM.STD_ENROLLMENTPRIORSGRP;


ALTER TABLE SDSADM.STD_ENROLLMENTPRIORSGRP ADD (
  CONSTRAINT PK_STD_ENROLLMENTPRIORSGRP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTPRIORSGRP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTPRIORSGRPCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ENROLLMENTPRIORSGRPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTPRIORSGRPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ENROLLMENTPRIORSGRPNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTPRIORSGRP TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRP TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRP TO ADRTMP;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRP TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTPRIORSGRP TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTPRIORSGRP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORSGRP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTPRIORGRPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTPRIORGRPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTPRIORGRPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTPRIORGRPHSTRY ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentPrrGrpHstry
after DELETE
ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY
BEGIN
	-- update the table for STD_EnrollmentPriorGrpHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorGrpHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentPrrGrpHstry
after INSERT
ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY
BEGIN
	-- update the table for STD_EnrollmentPriorGrpHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorGrpHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentPrrGrpHstry
after UPDATE
ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY
BEGIN
	-- update the table for STD_EnrollmentPriorGrpHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorGrpHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTPRIORGRPHISTORY FOR SDSADM.STD_ENROLLMENTPRIORGRPHISTORY;


ALTER TABLE SDSADM.STD_ENROLLMENTPRIORGRPHISTORY ADD (
  CONSTRAINT PK_STD_ENROLLMENTPRIORGRPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTPRIORGRPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ENROLLMENTPRIORGRPHISTORY ADD (
  CONSTRAINT FKSTD_ENRLLMNTPRRGRPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ENROLLMENTPRIORGRP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTPRIORGRP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTPRIORGRP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTPRIORGRP
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTPRIORGRP ON SDSADM.STD_ENROLLMENTPRIORGRP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTPRIORGRPCODE ON SDSADM.STD_ENROLLMENTPRIORGRP
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTPRIORGRPNAME ON SDSADM.STD_ENROLLMENTPRIORGRP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentPriorGrp
after DELETE
ON SDSADM.STD_ENROLLMENTPRIORGRP
BEGIN
	-- update the table for STD_EnrollmentPriorGrp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorGrp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentPriorGrp
after INSERT
ON SDSADM.STD_ENROLLMENTPRIORGRP
BEGIN
	-- update the table for STD_EnrollmentPriorGrp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorGrp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentPriorGrp
after UPDATE
ON SDSADM.STD_ENROLLMENTPRIORGRP
BEGIN
	-- update the table for STD_EnrollmentPriorGrp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentPriorGrp';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTPRIORGRP FOR SDSADM.STD_ENROLLMENTPRIORGRP;


ALTER TABLE SDSADM.STD_ENROLLMENTPRIORGRP ADD (
  CONSTRAINT PK_STD_ENROLLMENTPRIORGRP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTPRIORGRP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTPRIORGRPCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ENROLLMENTPRIORGRPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTPRIORGRPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ENROLLMENTPRIORGRPNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTPRIORGRP TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRP TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRP TO ADRTMP;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRP TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTPRIORGRP TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTPRIORGRP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTPRIORGRP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTOVRDERSNHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTOVRDERSNHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTOVRDERSNHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTOVRDERSNHSTRY ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrllmntOvrdRsnHstry
after DELETE
ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY
BEGIN
	-- update the table for STD_EnrollmentOvrdeRsnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentOvrdeRsnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrllmntOvrdRsnHstry
after INSERT
ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY
BEGIN
	-- update the table for STD_EnrollmentOvrdeRsnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentOvrdeRsnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrllmntOvrdRsnHstry
after UPDATE
ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY
BEGIN
	-- update the table for STD_EnrollmentOvrdeRsnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentOvrdeRsnHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTOVRDERSNHISTORY FOR SDSADM.STD_ENROLLMENTOVRDERSNHISTORY;


ALTER TABLE SDSADM.STD_ENROLLMENTOVRDERSNHISTORY ADD (
  CONSTRAINT PK_STD_ENROLLMENTOVRDERSNHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTOVRDERSNHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ENROLLMENTOVRDERSNHISTORY ADD (
  CONSTRAINT FKSTD_ENRLLMNTOVRDRSNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ENROLLMENTOVERRIDEREASON (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVRDERSNHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTOVERRIDEREASON
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTOVERRIDEREASON CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTOVERRIDEREASON
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTOVRDERSN ON SDSADM.STD_ENROLLMENTOVERRIDEREASON
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTOVRDERSNCODE ON SDSADM.STD_ENROLLMENTOVERRIDEREASON
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTOVRDERSNNAME ON SDSADM.STD_ENROLLMENTOVERRIDEREASON
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentOvrdeRsn
after DELETE
ON SDSADM.STD_ENROLLMENTOVERRIDEREASON
BEGIN
	-- update the table for STD_EnrollmentOverrideReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentOverrideReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentOvrdeRsn
after INSERT
ON SDSADM.STD_ENROLLMENTOVERRIDEREASON
BEGIN
	-- update the table for STD_EnrollmentOverrideReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentOverrideReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentOvrdeRsn
after UPDATE
ON SDSADM.STD_ENROLLMENTOVERRIDEREASON
BEGIN
	-- update the table for STD_EnrollmentOverrideReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentOverrideReason';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTOVERRIDEREASON FOR SDSADM.STD_ENROLLMENTOVERRIDEREASON;


ALTER TABLE SDSADM.STD_ENROLLMENTOVERRIDEREASON ADD (
  CONSTRAINT PK_STD_ENROLLMENTOVRDERSN
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTOVRDERSN
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTOVRDERSNCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ENROLLMENTOVRDERSNCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTOVRDERSNNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ENROLLMENTOVRDERSNNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTOVERRIDEREASON TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVERRIDEREASON TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVERRIDEREASON TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVERRIDEREASON TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTOVERRIDEREASON TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVERRIDEREASON TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTOVERRIDEREASON TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVERRIDEREASON TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTOVERRIDEREASON TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTCATTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTCATTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTCATTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTCATTYPEHSTRY ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentCatTypHstry
after DELETE
ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY
BEGIN
	-- update the table for STD_EnrollmentCatTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentCatTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentCatTypHstry
after INSERT
ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY
BEGIN
	-- update the table for STD_EnrollmentCatTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentCatTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentCatTypHstry
after UPDATE
ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY
BEGIN
	-- update the table for STD_EnrollmentCatTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentCatTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTCATTYPEHISTORY FOR SDSADM.STD_ENROLLMENTCATTYPEHISTORY;


ALTER TABLE SDSADM.STD_ENROLLMENTCATTYPEHISTORY ADD (
  CONSTRAINT PK_STD_ENROLLMENTCATTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTCATTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ENROLLMENTCATTYPEHISTORY ADD (
  CONSTRAINT FKSTD_ENROLLMENTCTTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ENROLLMENTCATTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ENROLLMENTCATTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ENROLLMENTCATTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ENROLLMENTCATTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ENROLLMENTCATTYPE ON SDSADM.STD_ENROLLMENTCATTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTCATTYPECODE ON SDSADM.STD_ENROLLMENTCATTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ENROLLMENTCATTYPENAME ON SDSADM.STD_ENROLLMENTCATTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EnrollmentCatType
after DELETE
ON SDSADM.STD_ENROLLMENTCATTYPE
BEGIN
	-- update the table for STD_EnrollmentCatType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentCatType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EnrollmentCatType
after INSERT
ON SDSADM.STD_ENROLLMENTCATTYPE
BEGIN
	-- update the table for STD_EnrollmentCatType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentCatType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EnrollmentCatType
after UPDATE
ON SDSADM.STD_ENROLLMENTCATTYPE
BEGIN
	-- update the table for STD_EnrollmentCatType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EnrollmentCatType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ENROLLMENTCATTYPE FOR SDSADM.STD_ENROLLMENTCATTYPE;


ALTER TABLE SDSADM.STD_ENROLLMENTCATTYPE ADD (
  CONSTRAINT PK_STD_ENROLLMENTCATTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ENROLLMENTCATTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTCATTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ENROLLMENTCATTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ENROLLMENTCATTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ENROLLMENTCATTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTCATTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ENROLLMENTCATTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ENROLLMENTCATTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ENROLLMENTCATTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMPLOYMENTSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMPLOYMENTSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMPLOYMENTSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMPLOYMENTSTATUSHISTORY ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EmploymentStatusHstry
after DELETE
ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY
BEGIN
	-- update the table for STD_EmploymentStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmploymentStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EmploymentStatusHstry
after INSERT
ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY
BEGIN
	-- update the table for STD_EmploymentStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmploymentStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EmploymentStatusHstry
after UPDATE
ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY
BEGIN
	-- update the table for STD_EmploymentStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmploymentStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMPLOYMENTSTATUSHISTORY FOR SDSADM.STD_EMPLOYMENTSTATUSHISTORY;


ALTER TABLE SDSADM.STD_EMPLOYMENTSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_EMPLOYMENTSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMPLOYMENTSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EMPLOYMENTSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_EMPLOYMENTSTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EMPLOYMENTSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMPLOYMENTSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMPLOYMENTSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMPLOYMENTSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMPLOYMENTSTATUS ON SDSADM.STD_EMPLOYMENTSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EMPLOYMENTSTATUSCODE ON SDSADM.STD_EMPLOYMENTSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EMPLOYMENTSTATUSNAME ON SDSADM.STD_EMPLOYMENTSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EmploymentStatus
after DELETE
ON SDSADM.STD_EMPLOYMENTSTATUS
BEGIN
	-- update the table for STD_EmploymentStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmploymentStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EmploymentStatus
after INSERT
ON SDSADM.STD_EMPLOYMENTSTATUS
BEGIN
	-- update the table for STD_EmploymentStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmploymentStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EmploymentStatus
after UPDATE
ON SDSADM.STD_EMPLOYMENTSTATUS
BEGIN
	-- update the table for STD_EmploymentStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmploymentStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMPLOYMENTSTATUS FOR SDSADM.STD_EMPLOYMENTSTATUS;


ALTER TABLE SDSADM.STD_EMPLOYMENTSTATUS ADD (
  CONSTRAINT PK_STD_EMPLOYMENTSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMPLOYMENTSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EMPLOYMENTSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EMPLOYMENTSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EMPLOYMENTSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EMPLOYMENTSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMPLOYMENTSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMPLOYMENTSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMPLOYMENTSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMPLOYMENTSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMERGENCYRESPONSEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMERGENCYRESPONSEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMERGENCYRESPONSEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMERGENCYRESPONSEHSTRY ON SDSADM.STD_EMERGENCYRESPONSEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EmergencyRspnsHstry
after DELETE
ON SDSADM.STD_EMERGENCYRESPONSEHISTORY
BEGIN
	-- update the table for STD_EmergencyResponseHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmergencyResponseHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EmergencyRspnsHstry
after INSERT
ON SDSADM.STD_EMERGENCYRESPONSEHISTORY
BEGIN
	-- update the table for STD_EmergencyResponseHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmergencyResponseHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EmergencyRspnsHstry
after UPDATE
ON SDSADM.STD_EMERGENCYRESPONSEHISTORY
BEGIN
	-- update the table for STD_EmergencyResponseHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmergencyResponseHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMERGENCYRESPONSEHISTORY FOR SDSADM.STD_EMERGENCYRESPONSEHISTORY;


ALTER TABLE SDSADM.STD_EMERGENCYRESPONSEHISTORY ADD (
  CONSTRAINT PK_STD_EMERGENCYRESPONSEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMERGENCYRESPONSEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EMERGENCYRESPONSEHISTORY ADD (
  CONSTRAINT FKSTD_EMERGENCYRSPNSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EMERGENCYRESPONSE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMERGENCYRESPONSEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMERGENCYRESPONSEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMERGENCYRESPONSEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMERGENCYRESPONSE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMERGENCYRESPONSE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMERGENCYRESPONSE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMERGENCYRESPONSE ON SDSADM.STD_EMERGENCYRESPONSE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EMERGENCYRESPONSECODE ON SDSADM.STD_EMERGENCYRESPONSE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EMERGENCYRESPONSENAME ON SDSADM.STD_EMERGENCYRESPONSE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EmergencyResponse
after DELETE
ON SDSADM.STD_EMERGENCYRESPONSE
BEGIN
	-- update the table for STD_EmergencyResponse operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmergencyResponse';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EmergencyResponse
after INSERT
ON SDSADM.STD_EMERGENCYRESPONSE
BEGIN
	-- update the table for STD_EmergencyResponse operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmergencyResponse';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EmergencyResponse
after UPDATE
ON SDSADM.STD_EMERGENCYRESPONSE
BEGIN
	-- update the table for STD_EmergencyResponse operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmergencyResponse';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMERGENCYRESPONSE FOR SDSADM.STD_EMERGENCYRESPONSE;


ALTER TABLE SDSADM.STD_EMERGENCYRESPONSE ADD (
  CONSTRAINT PK_STD_EMERGENCYRESPONSE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMERGENCYRESPONSE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EMERGENCYRESPONSECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EMERGENCYRESPONSECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EMERGENCYRESPONSENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EMERGENCYRESPONSENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMERGENCYRESPONSE TO ADR;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSE TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSE TO EESRV;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMERGENCYRESPONSE TO LOBR;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMERGENCYRESPONSE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMERGENCYRESPONSE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMAIL_DOMAINHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMAIL_DOMAINHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMAIL_DOMAINHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMAIL_DOMAINHISTORY ON SDSADM.STD_EMAIL_DOMAINHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Email_DomainHistory
after DELETE
ON SDSADM.STD_EMAIL_DOMAINHISTORY
BEGIN
	-- update the table for STD_Email_DomainHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Email_DomainHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Email_DomainHistory
after INSERT
ON SDSADM.STD_EMAIL_DOMAINHISTORY
BEGIN
	-- update the table for STD_Email_DomainHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Email_DomainHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Email_DomainHistory
after UPDATE
ON SDSADM.STD_EMAIL_DOMAINHISTORY
BEGIN
	-- update the table for STD_Email_DomainHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Email_DomainHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMAIL_DOMAINHISTORY FOR SDSADM.STD_EMAIL_DOMAINHISTORY;


ALTER TABLE SDSADM.STD_EMAIL_DOMAINHISTORY ADD (
  CONSTRAINT PK_STD_EMAIL_DOMAINHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMAIL_DOMAINHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EMAIL_DOMAINHISTORY ADD (
  CONSTRAINT FKSTD_EMAIL_DOMAINHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EMAIL_DOMAIN (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMAIL_DOMAINHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAINHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAINHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAINHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMAIL_DOMAINHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAINHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMAIL_DOMAINHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAINHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAINHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMAIL_DOMAIN
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMAIL_DOMAIN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMAIL_DOMAIN
(
  ID                 NUMBER(20)                 NOT NULL,
  INSTITUTION_ID     NUMBER(20)                 NOT NULL,
  EMAIL_DOMAIN_NAME  VARCHAR2(50 BYTE)          NOT NULL,
  VERSION            INTEGER                    NOT NULL,
  CREATED            TIMESTAMP(6)               NOT NULL,
  UPDATED            TIMESTAMP(6),
  CREATEDBY          VARCHAR2(32 BYTE)          NOT NULL,
  UPDATEDBY          VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMAIL_DOMAIN ON SDSADM.STD_EMAIL_DOMAIN
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EMAIL_DOMAININSTITUTION ON SDSADM.STD_EMAIL_DOMAIN
(INSTITUTION_ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Email_Domain
after DELETE
ON SDSADM.STD_EMAIL_DOMAIN
BEGIN
	-- update the table for STD_Email_Domain operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Email_Domain';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Email_Domain
after INSERT
ON SDSADM.STD_EMAIL_DOMAIN
BEGIN
	-- update the table for STD_Email_Domain operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Email_Domain';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Email_Domain
after UPDATE
ON SDSADM.STD_EMAIL_DOMAIN
BEGIN
	-- update the table for STD_Email_Domain operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Email_Domain';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMAIL_DOMAIN FOR SDSADM.STD_EMAIL_DOMAIN;


ALTER TABLE SDSADM.STD_EMAIL_DOMAIN ADD (
  CONSTRAINT PK_STD_EMAIL_DOMAIN
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMAIL_DOMAIN
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EMAIL_DOMAININSTITUTION
  UNIQUE (INSTITUTION_ID)
  USING INDEX SDSADM.UQSTD_EMAIL_DOMAININSTITUTION
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EMAIL_DOMAIN ADD (
  CONSTRAINT FKSTD_EMAIL_DOMAININSTITUTION 
  FOREIGN KEY (INSTITUTION_ID) 
  REFERENCES SDSADM.STD_INSTITUTION (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMAIL_DOMAIN TO ADR;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAIN TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAIN TO EESRV;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAIN TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMAIL_DOMAIN TO LOBR;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAIN TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMAIL_DOMAIN TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAIN TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMAIL_DOMAIN TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMAILCHANGESOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMAILCHANGESOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMAILCHANGESOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMAILCHANGESOURCEHSTRY ON SDSADM.STD_EMAILCHANGESOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EmailChangeSrcHstry
after DELETE
ON SDSADM.STD_EMAILCHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_EmailChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EmailChangeSrcHstry
after INSERT
ON SDSADM.STD_EMAILCHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_EmailChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EmailChangeSrcHstry
after UPDATE
ON SDSADM.STD_EMAILCHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_EmailChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailChangeSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMAILCHANGESOURCEHISTORY FOR SDSADM.STD_EMAILCHANGESOURCEHISTORY;


ALTER TABLE SDSADM.STD_EMAILCHANGESOURCEHISTORY ADD (
  CONSTRAINT PK_STD_EMAILCHANGESOURCEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMAILCHANGESOURCEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EMAILCHANGESOURCEHISTORY ADD (
  CONSTRAINT FKSTD_EMAILCHANGESRCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EMAILCHANGESOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMAILCHANGESOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMAILCHANGESOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMAILCHANGESOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMAILCHANGESOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMAILCHANGESOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMAILCHANGESOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMAILCHANGESOURCE ON SDSADM.STD_EMAILCHANGESOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EMAILCHANGESOURCECODE ON SDSADM.STD_EMAILCHANGESOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EMAILCHANGESOURCENAME ON SDSADM.STD_EMAILCHANGESOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EmailChangeSource
after DELETE
ON SDSADM.STD_EMAILCHANGESOURCE
BEGIN
	-- update the table for STD_EmailChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EmailChangeSource
after INSERT
ON SDSADM.STD_EMAILCHANGESOURCE
BEGIN
	-- update the table for STD_EmailChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EmailChangeSource
after UPDATE
ON SDSADM.STD_EMAILCHANGESOURCE
BEGIN
	-- update the table for STD_EmailChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailChangeSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMAILCHANGESOURCE FOR SDSADM.STD_EMAILCHANGESOURCE;


ALTER TABLE SDSADM.STD_EMAILCHANGESOURCE ADD (
  CONSTRAINT PK_STD_EMAILCHANGESOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMAILCHANGESOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EMAILCHANGESOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EMAILCHANGESOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EMAILCHANGESOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EMAILCHANGESOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMAILCHANGESOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMAILCHANGESOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMAILCHANGESOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMAILCHANGESOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMAILADDRESSTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMAILADDRESSTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMAILADDRESSTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMAILADDRESSTYPEHISTORY ON SDSADM.STD_EMAILADDRESSTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EmailAddressTypeHstry
after DELETE
ON SDSADM.STD_EMAILADDRESSTYPEHISTORY
BEGIN
	-- update the table for STD_EmailAddressTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailAddressTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EmailAddressTypeHstry
after INSERT
ON SDSADM.STD_EMAILADDRESSTYPEHISTORY
BEGIN
	-- update the table for STD_EmailAddressTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailAddressTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EmailAddressTypeHstry
after UPDATE
ON SDSADM.STD_EMAILADDRESSTYPEHISTORY
BEGIN
	-- update the table for STD_EmailAddressTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailAddressTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMAILADDRESSTYPEHISTORY FOR SDSADM.STD_EMAILADDRESSTYPEHISTORY;


ALTER TABLE SDSADM.STD_EMAILADDRESSTYPEHISTORY ADD (
  CONSTRAINT PK_STD_EMAILADDRESSTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMAILADDRESSTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EMAILADDRESSTYPEHISTORY ADD (
  CONSTRAINT FKSTD_EMAILADDRESSTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EMAILADDRESSTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMAILADDRESSTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMAILADDRESSTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMAILADDRESSTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EMAILADDRESSTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EMAILADDRESSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EMAILADDRESSTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EMAILADDRESSTYPE ON SDSADM.STD_EMAILADDRESSTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EMAILADDRESSTYPECODE ON SDSADM.STD_EMAILADDRESSTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EMAILADDRESSTYPENAME ON SDSADM.STD_EMAILADDRESSTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EmailAddressType
after DELETE
ON SDSADM.STD_EMAILADDRESSTYPE
BEGIN
	-- update the table for STD_EmailAddressType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailAddressType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EmailAddressType
after INSERT
ON SDSADM.STD_EMAILADDRESSTYPE
BEGIN
	-- update the table for STD_EmailAddressType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailAddressType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EmailAddressType
after UPDATE
ON SDSADM.STD_EMAILADDRESSTYPE
BEGIN
	-- update the table for STD_EmailAddressType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EmailAddressType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EMAILADDRESSTYPE FOR SDSADM.STD_EMAILADDRESSTYPE;


ALTER TABLE SDSADM.STD_EMAILADDRESSTYPE ADD (
  CONSTRAINT PK_STD_EMAILADDRESSTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EMAILADDRESSTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EMAILADDRESSTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EMAILADDRESSTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EMAILADDRESSTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EMAILADDRESSTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EMAILADDRESSTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EMAILADDRESSTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EMAILADDRESSTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EMAILADDRESSTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGPRMRYDATASRCHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGPRMRYDATASRCHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGPRMRYDATASRCHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGPRMRYDATASRCHISTORY ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligPrmryDataSrcHstry
after DELETE
ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY
BEGIN
	-- update the table for STD_EligPrmryDataSrcHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligPrmryDataSrcHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligPrmryDataSrcHstry
after INSERT
ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY
BEGIN
	-- update the table for STD_EligPrmryDataSrcHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligPrmryDataSrcHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligPrmryDataSrcHstry
after UPDATE
ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY
BEGIN
	-- update the table for STD_EligPrmryDataSrcHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligPrmryDataSrcHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGPRMRYDATASRCHISTORY FOR SDSADM.STD_ELIGPRMRYDATASRCHISTORY;


ALTER TABLE SDSADM.STD_ELIGPRMRYDATASRCHISTORY ADD (
  CONSTRAINT PK_STD_ELIGPRMRYDATASRCHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGPRMRYDATASRCHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ELIGPRMRYDATASRCHISTORY ADD (
  CONSTRAINT FKSTD_ELIGPRMRYDTSRCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ELIGIBILITYPRIMARYDATASRC (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGPRMRYDATASRCHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYVRSCTYPHSTRY ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ElgbltyVrScTypHstry
after DELETE
ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY
BEGIN
	-- update the table for STD_EligibilityVrScTypHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityVrScTypHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ElgbltyVrScTypHstry
after INSERT
ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY
BEGIN
	-- update the table for STD_EligibilityVrScTypHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityVrScTypHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ElgbltyVrScTypHstry
after UPDATE
ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY
BEGIN
	-- update the table for STD_EligibilityVrScTypHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityVrScTypHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYVRSCTYPHISTORY FOR SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY;


ALTER TABLE SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY ADD (
  CONSTRAINT PK_STD_ELIGIBILITYVRSCTYPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYVRSCTYPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY ADD (
  CONSTRAINT FKSTD_ELGBLTYVRSCTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ELIGIBILITYVRSCTYP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYVRSCTYP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYVRSCTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYVRSCTYP
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(30 BYTE)                NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYVRSCTYP ON SDSADM.STD_ELIGIBILITYVRSCTYP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYVRSCTYPCODE ON SDSADM.STD_ELIGIBILITYVRSCTYP
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYVRSCTYPNAME ON SDSADM.STD_ELIGIBILITYVRSCTYP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligibilityVrScTyp
after DELETE
ON SDSADM.STD_ELIGIBILITYVRSCTYP
BEGIN
	-- update the table for STD_EligibilityVrScTyp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityVrScTyp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligibilityVrScTyp
after INSERT
ON SDSADM.STD_ELIGIBILITYVRSCTYP
BEGIN
	-- update the table for STD_EligibilityVrScTyp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityVrScTyp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligibilityVrScTyp
after UPDATE
ON SDSADM.STD_ELIGIBILITYVRSCTYP
BEGIN
	-- update the table for STD_EligibilityVrScTyp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityVrScTyp';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYVRSCTYP FOR SDSADM.STD_ELIGIBILITYVRSCTYP;


ALTER TABLE SDSADM.STD_ELIGIBILITYVRSCTYP ADD (
  CONSTRAINT PK_STD_ELIGIBILITYVRSCTYP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYVRSCTYP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYVRSCTYPCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYVRSCTYPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYVRSCTYPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYVRSCTYPNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYVRSCTYP TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYP TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYP TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYVRSCTYP TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYVRSCTYP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYVRSCTYP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYSTATUSHSTRY ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligibilitySttsHstry
after DELETE
ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY
BEGIN
	-- update the table for STD_EligibilityStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligibilitySttsHstry
after INSERT
ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY
BEGIN
	-- update the table for STD_EligibilityStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligibilitySttsHstry
after UPDATE
ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY
BEGIN
	-- update the table for STD_EligibilityStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYSTATUSHISTORY FOR SDSADM.STD_ELIGIBILITYSTATUSHISTORY;


ALTER TABLE SDSADM.STD_ELIGIBILITYSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_ELIGIBILITYSTATUSHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYSTATUSHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ELIGIBILITYSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_ELIGIBILITYSTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ELIGIBILITYSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYSTATUS ON SDSADM.STD_ELIGIBILITYSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYSTATUSCODE ON SDSADM.STD_ELIGIBILITYSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYSTATUSNAME ON SDSADM.STD_ELIGIBILITYSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligibilityStatus
after DELETE
ON SDSADM.STD_ELIGIBILITYSTATUS
BEGIN
	-- update the table for STD_EligibilityStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligibilityStatus
after INSERT
ON SDSADM.STD_ELIGIBILITYSTATUS
BEGIN
	-- update the table for STD_EligibilityStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligibilityStatus
after UPDATE
ON SDSADM.STD_ELIGIBILITYSTATUS
BEGIN
	-- update the table for STD_EligibilityStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYSTATUS FOR SDSADM.STD_ELIGIBILITYSTATUS;


ALTER TABLE SDSADM.STD_ELIGIBILITYSTATUS ADD (
  CONSTRAINT PK_STD_ELIGIBILITYSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYPRIMARYDATASRC
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYPRIMARYDATASRC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYPRIMARYDATASRC
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(30 BYTE)                NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGPRMRYDATASRC ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGPRMRYDATASRCCODE ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGPRMRYDATASRCNAME ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligPrmryDataSrc
after DELETE
ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC
BEGIN
	-- update the table for STD_EligibilityPrimaryDataSrc operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityPrimaryDataSrc';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligPrmryDataSrc
after INSERT
ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC
BEGIN
	-- update the table for STD_EligibilityPrimaryDataSrc operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityPrimaryDataSrc';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligPrmryDataSrc
after UPDATE
ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC
BEGIN
	-- update the table for STD_EligibilityPrimaryDataSrc operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityPrimaryDataSrc';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYPRIMARYDATASRC FOR SDSADM.STD_ELIGIBILITYPRIMARYDATASRC;


ALTER TABLE SDSADM.STD_ELIGIBILITYPRIMARYDATASRC ADD (
  CONSTRAINT PK_STD_ELIGPRMRYDATASRC
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGPRMRYDATASRC
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGPRMRYDATASRCCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ELIGPRMRYDATASRCCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGPRMRYDATASRCNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ELIGPRMRYDATASRCNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYPRIMARYDATASRC TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYFACTORHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYFACTORHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYFACTORHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYFACTORHSTRY ON SDSADM.STD_ELIGIBILITYFACTORHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligibilityFctrHstry
after DELETE
ON SDSADM.STD_ELIGIBILITYFACTORHISTORY
BEGIN
	-- update the table for STD_EligibilityFactorHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityFactorHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligibilityFctrHstry
after INSERT
ON SDSADM.STD_ELIGIBILITYFACTORHISTORY
BEGIN
	-- update the table for STD_EligibilityFactorHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityFactorHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligibilityFctrHstry
after UPDATE
ON SDSADM.STD_ELIGIBILITYFACTORHISTORY
BEGIN
	-- update the table for STD_EligibilityFactorHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityFactorHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYFACTORHISTORY FOR SDSADM.STD_ELIGIBILITYFACTORHISTORY;


ALTER TABLE SDSADM.STD_ELIGIBILITYFACTORHISTORY ADD (
  CONSTRAINT PK_STD_ELIGIBILITYFACTORHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYFACTORHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ELIGIBILITYFACTORHISTORY ADD (
  CONSTRAINT FKSTD_ELIGIBILITYFCTRHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ELIGIBILITYFACTOR (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYFACTORHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTORHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTORHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTORHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYFACTORHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTORHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYFACTORHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTORHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTORHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYFACTOR
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYFACTOR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYFACTOR
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(2 BYTE)                     NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYFACTOR ON SDSADM.STD_ELIGIBILITYFACTOR
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYFACTORCODE ON SDSADM.STD_ELIGIBILITYFACTOR
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYFACTORNAME ON SDSADM.STD_ELIGIBILITYFACTOR
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligibilityFactor
after DELETE
ON SDSADM.STD_ELIGIBILITYFACTOR
BEGIN
	-- update the table for STD_EligibilityFactor operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityFactor';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligibilityFactor
after INSERT
ON SDSADM.STD_ELIGIBILITYFACTOR
BEGIN
	-- update the table for STD_EligibilityFactor operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityFactor';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligibilityFactor
after UPDATE
ON SDSADM.STD_ELIGIBILITYFACTOR
BEGIN
	-- update the table for STD_EligibilityFactor operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityFactor';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYFACTOR FOR SDSADM.STD_ELIGIBILITYFACTOR;


ALTER TABLE SDSADM.STD_ELIGIBILITYFACTOR ADD (
  CONSTRAINT PK_STD_ELIGIBILITYFACTOR
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYFACTOR
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYFACTORCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYFACTORCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYFACTORNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYFACTORNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYFACTOR TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTOR TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTOR TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTOR TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYFACTOR TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTOR TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYFACTOR TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTOR TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYFACTOR TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYCODETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYCODETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYCODETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYCODETYPHSTRY ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligibilityCdTypHstry
after DELETE
ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY
BEGIN
	-- update the table for STD_EligibilityCodeTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCodeTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligibilityCdTypHstry
after INSERT
ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY
BEGIN
	-- update the table for STD_EligibilityCodeTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCodeTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligibilityCdTypHstry
after UPDATE
ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY
BEGIN
	-- update the table for STD_EligibilityCodeTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCodeTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYCODETYPEHISTORY FOR SDSADM.STD_ELIGIBILITYCODETYPEHISTORY;


ALTER TABLE SDSADM.STD_ELIGIBILITYCODETYPEHISTORY ADD (
  CONSTRAINT PK_STD_ELIGIBILITYCODETYPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYCODETYPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ELIGIBILITYCODETYPEHISTORY ADD (
  CONSTRAINT FKSTD_ELGBLTYCDTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ELIGIBILITYCODETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYCODETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYCODETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYCODETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(20 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYCODETYPE ON SDSADM.STD_ELIGIBILITYCODETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYCODETYPECODE ON SDSADM.STD_ELIGIBILITYCODETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYCODETYPENAME ON SDSADM.STD_ELIGIBILITYCODETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligibilityCodeType
after DELETE
ON SDSADM.STD_ELIGIBILITYCODETYPE
BEGIN
	-- update the table for STD_EligibilityCodeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCodeType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligibilityCodeType
after INSERT
ON SDSADM.STD_ELIGIBILITYCODETYPE
BEGIN
	-- update the table for STD_EligibilityCodeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCodeType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligibilityCodeType
after UPDATE
ON SDSADM.STD_ELIGIBILITYCODETYPE
BEGIN
	-- update the table for STD_EligibilityCodeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCodeType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYCODETYPE FOR SDSADM.STD_ELIGIBILITYCODETYPE;


ALTER TABLE SDSADM.STD_ELIGIBILITYCODETYPE ADD (
  CONSTRAINT PK_STD_ELIGIBILITYCODETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYCODETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYCODETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYCODETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYCODETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYCODETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYCODETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYCODETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYCODETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYCODEHISTORY ON SDSADM.STD_ELIGIBILITYCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligibilityCodeHstry
after DELETE
ON SDSADM.STD_ELIGIBILITYCODEHISTORY
BEGIN
	-- update the table for STD_EligibilityCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligibilityCodeHstry
after INSERT
ON SDSADM.STD_ELIGIBILITYCODEHISTORY
BEGIN
	-- update the table for STD_EligibilityCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligibilityCodeHstry
after UPDATE
ON SDSADM.STD_ELIGIBILITYCODEHISTORY
BEGIN
	-- update the table for STD_EligibilityCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYCODEHISTORY FOR SDSADM.STD_ELIGIBILITYCODEHISTORY;


ALTER TABLE SDSADM.STD_ELIGIBILITYCODEHISTORY ADD (
  CONSTRAINT PK_STD_ELIGIBILITYCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ELIGIBILITYCODEHISTORY ADD (
  CONSTRAINT FKSTD_ELIGIBILITYCODEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ELIGIBILITYCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGIBILITYCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGIBILITYCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGIBILITYCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  VACODETYPE   NUMBER(10)                       NOT NULL,
  TYPE_ID      NUMBER(20)                       NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGIBILITYCODE ON SDSADM.STD_ELIGIBILITYCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYCODECODE ON SDSADM.STD_ELIGIBILITYCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGIBILITYCODENAME ON SDSADM.STD_ELIGIBILITYCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligibilityCode
after DELETE
ON SDSADM.STD_ELIGIBILITYCODE
BEGIN
	-- update the table for STD_EligibilityCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligibilityCode
after INSERT
ON SDSADM.STD_ELIGIBILITYCODE
BEGIN
	-- update the table for STD_EligibilityCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligibilityCode
after UPDATE
ON SDSADM.STD_ELIGIBILITYCODE
BEGIN
	-- update the table for STD_EligibilityCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligibilityCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGIBILITYCODE FOR SDSADM.STD_ELIGIBILITYCODE;


ALTER TABLE SDSADM.STD_ELIGIBILITYCODE ADD (
  CONSTRAINT PK_STD_ELIGIBILITYCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGIBILITYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGIBILITYCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ELIGIBILITYCODENAME
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ELIGIBILITYCODE ADD (
  CONSTRAINT FKSTD_ELIGIBILITYCODETYPE 
  FOREIGN KEY (TYPE_ID) 
  REFERENCES SDSADM.STD_ELIGIBILITYCODETYPE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYCODE TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGIBILITYCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGIBILITYCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGIBILITYCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGDOCTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGDOCTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGDOCTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGDOCTYPEHISTORY ON SDSADM.STD_ELIGDOCTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligDocTypeHistory
after DELETE
ON SDSADM.STD_ELIGDOCTYPEHISTORY
BEGIN
	-- update the table for STD_EligDocTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligDocTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligDocTypeHistory
after INSERT
ON SDSADM.STD_ELIGDOCTYPEHISTORY
BEGIN
	-- update the table for STD_EligDocTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligDocTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligDocTypeHistory
after UPDATE
ON SDSADM.STD_ELIGDOCTYPEHISTORY
BEGIN
	-- update the table for STD_EligDocTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligDocTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGDOCTYPEHISTORY FOR SDSADM.STD_ELIGDOCTYPEHISTORY;


ALTER TABLE SDSADM.STD_ELIGDOCTYPEHISTORY ADD (
  CONSTRAINT PK_STD_ELIGDOCTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGDOCTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ELIGDOCTYPEHISTORY ADD (
  CONSTRAINT FKSTD_ELIGDOCTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ELIGDOCTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGDOCTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGDOCTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGDOCTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELIGDOCTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELIGDOCTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELIGDOCTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(200 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELIGDOCTYPE ON SDSADM.STD_ELIGDOCTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGDOCTYPECODE ON SDSADM.STD_ELIGDOCTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELIGDOCTYPENAME ON SDSADM.STD_ELIGDOCTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EligDocType
after DELETE
ON SDSADM.STD_ELIGDOCTYPE
BEGIN
	-- update the table for STD_EligDocType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligDocType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EligDocType
after INSERT
ON SDSADM.STD_ELIGDOCTYPE
BEGIN
	-- update the table for STD_EligDocType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligDocType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EligDocType
after UPDATE
ON SDSADM.STD_ELIGDOCTYPE
BEGIN
	-- update the table for STD_EligDocType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EligDocType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELIGDOCTYPE FOR SDSADM.STD_ELIGDOCTYPE;


ALTER TABLE SDSADM.STD_ELIGDOCTYPE ADD (
  CONSTRAINT PK_STD_ELIGDOCTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELIGDOCTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGDOCTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ELIGDOCTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELIGDOCTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ELIGDOCTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELIGDOCTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELIGDOCTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELIGDOCTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELIGDOCTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELECTRONICPLANTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELECTRONICPLANTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELECTRONICPLANTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELECTRONICPLANTYPEHSTRY ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ElectronicPlnTypHstry
after DELETE
ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY
BEGIN
	-- update the table for STD_ElectronicPlanTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ElectronicPlanTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ElectronicPlnTypHstry
after INSERT
ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY
BEGIN
	-- update the table for STD_ElectronicPlanTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ElectronicPlanTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ElectronicPlnTypHstry
after UPDATE
ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY
BEGIN
	-- update the table for STD_ElectronicPlanTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ElectronicPlanTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELECTRONICPLANTYPEHISTORY FOR SDSADM.STD_ELECTRONICPLANTYPEHISTORY;


ALTER TABLE SDSADM.STD_ELECTRONICPLANTYPEHISTORY ADD (
  CONSTRAINT PK_STD_ELECTRONICPLANTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELECTRONICPLANTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ELECTRONICPLANTYPEHISTORY ADD (
  CONSTRAINT FKSTD_ELCTRNCPLNTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ELECTRONICPLANTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ELECTRONICPLANTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ELECTRONICPLANTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ELECTRONICPLANTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ELECTRONICPLANTYPE ON SDSADM.STD_ELECTRONICPLANTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELECTRONICPLANTYPECODE ON SDSADM.STD_ELECTRONICPLANTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ELECTRONICPLANTYPENAME ON SDSADM.STD_ELECTRONICPLANTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ElectronicPlanType
after DELETE
ON SDSADM.STD_ELECTRONICPLANTYPE
BEGIN
	-- update the table for STD_ElectronicPlanType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ElectronicPlanType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ElectronicPlanType
after INSERT
ON SDSADM.STD_ELECTRONICPLANTYPE
BEGIN
	-- update the table for STD_ElectronicPlanType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ElectronicPlanType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ElectronicPlanType
after UPDATE
ON SDSADM.STD_ELECTRONICPLANTYPE
BEGIN
	-- update the table for STD_ElectronicPlanType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ElectronicPlanType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ELECTRONICPLANTYPE FOR SDSADM.STD_ELECTRONICPLANTYPE;


ALTER TABLE SDSADM.STD_ELECTRONICPLANTYPE ADD (
  CONSTRAINT PK_STD_ELECTRONICPLANTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ELECTRONICPLANTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELECTRONICPLANTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ELECTRONICPLANTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ELECTRONICPLANTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ELECTRONICPLANTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ELECTRONICPLANTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ELECTRONICPLANTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ELECTRONICPLANTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ELECTRONICPLANTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EGTTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EGTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EGTTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EGTTYPEHISTORY ON SDSADM.STD_EGTTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EgtTypeHistory
after DELETE
ON SDSADM.STD_EGTTYPEHISTORY
BEGIN
	-- update the table for STD_EgtTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EgtTypeHistory
after INSERT
ON SDSADM.STD_EGTTYPEHISTORY
BEGIN
	-- update the table for STD_EgtTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EgtTypeHistory
after UPDATE
ON SDSADM.STD_EGTTYPEHISTORY
BEGIN
	-- update the table for STD_EgtTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EGTTYPEHISTORY FOR SDSADM.STD_EGTTYPEHISTORY;


ALTER TABLE SDSADM.STD_EGTTYPEHISTORY ADD (
  CONSTRAINT PK_STD_EGTTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EGTTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EGTTYPEHISTORY ADD (
  CONSTRAINT FKSTD_EGTTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EGTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EGTTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EGTTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EGTTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EGTTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EGTTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EGTTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EGTTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EGTTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EGTTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EGTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EGTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EGTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EGTTYPE ON SDSADM.STD_EGTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EGTTYPECODE ON SDSADM.STD_EGTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EGTTYPENAME ON SDSADM.STD_EGTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EgtType
after DELETE
ON SDSADM.STD_EGTTYPE
BEGIN
	-- update the table for STD_EgtType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EgtType
after INSERT
ON SDSADM.STD_EGTTYPE
BEGIN
	-- update the table for STD_EgtType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EgtType
after UPDATE
ON SDSADM.STD_EGTTYPE
BEGIN
	-- update the table for STD_EgtType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EGTTYPE FOR SDSADM.STD_EGTTYPE;


ALTER TABLE SDSADM.STD_EGTTYPE ADD (
  CONSTRAINT PK_STD_EGTTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EGTTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EGTTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EGTTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EGTTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EGTTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EGTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_EGTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_EGTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_EGTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EGTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_EGTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EGTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EGTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EGTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EGTPROCESSSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EGTPROCESSSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EGTPROCESSSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EGTPROCESSSTATUSHISTORY ON SDSADM.STD_EGTPROCESSSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EgtProcessStatusHstry
after DELETE
ON SDSADM.STD_EGTPROCESSSTATUSHISTORY
BEGIN
	-- update the table for STD_EgtProcessStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtProcessStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EgtProcessStatusHstry
after INSERT
ON SDSADM.STD_EGTPROCESSSTATUSHISTORY
BEGIN
	-- update the table for STD_EgtProcessStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtProcessStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EgtProcessStatusHstry
after UPDATE
ON SDSADM.STD_EGTPROCESSSTATUSHISTORY
BEGIN
	-- update the table for STD_EgtProcessStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtProcessStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EGTPROCESSSTATUSHISTORY FOR SDSADM.STD_EGTPROCESSSTATUSHISTORY;


ALTER TABLE SDSADM.STD_EGTPROCESSSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_EGTPROCESSSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EGTPROCESSSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_EGTPROCESSSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_EGTPROCESSSTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_EGTPROCESSSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EGTPROCESSSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EGTPROCESSSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EGTPROCESSSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_EGTPROCESSSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_EGTPROCESSSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_EGTPROCESSSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_EGTPROCESSSTATUS ON SDSADM.STD_EGTPROCESSSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EGTPROCESSSTATUSCODE ON SDSADM.STD_EGTPROCESSSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_EGTPROCESSSTATUSNAME ON SDSADM.STD_EGTPROCESSSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_EgtProcessStatus
after DELETE
ON SDSADM.STD_EGTPROCESSSTATUS
BEGIN
	-- update the table for STD_EgtProcessStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtProcessStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_EgtProcessStatus
after INSERT
ON SDSADM.STD_EGTPROCESSSTATUS
BEGIN
	-- update the table for STD_EgtProcessStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtProcessStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_EgtProcessStatus
after UPDATE
ON SDSADM.STD_EGTPROCESSSTATUS
BEGIN
	-- update the table for STD_EgtProcessStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_EgtProcessStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_EGTPROCESSSTATUS FOR SDSADM.STD_EGTPROCESSSTATUS;


ALTER TABLE SDSADM.STD_EGTPROCESSSTATUS ADD (
  CONSTRAINT PK_STD_EGTPROCESSSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_EGTPROCESSSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EGTPROCESSSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_EGTPROCESSSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_EGTPROCESSSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_EGTPROCESSSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_EGTPROCESSSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_EGTPROCESSSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_EGTPROCESSSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_EGTPROCESSSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DOCUMENTSOURCETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DOCUMENTSOURCETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DOCUMENTSOURCETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DOCUMENTSOURCETYPEHSTRY ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DocumentSrcTypHstry
after DELETE
ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY
BEGIN
	-- update the table for STD_DocumentSourceTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DocumentSourceTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DocumentSrcTypHstry
after INSERT
ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY
BEGIN
	-- update the table for STD_DocumentSourceTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DocumentSourceTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DocumentSrcTypHstry
after UPDATE
ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY
BEGIN
	-- update the table for STD_DocumentSourceTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DocumentSourceTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DOCUMENTSOURCETYPEHISTORY FOR SDSADM.STD_DOCUMENTSOURCETYPEHISTORY;


ALTER TABLE SDSADM.STD_DOCUMENTSOURCETYPEHISTORY ADD (
  CONSTRAINT PK_STD_DOCUMENTSOURCETYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DOCUMENTSOURCETYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DOCUMENTSOURCETYPEHISTORY ADD (
  CONSTRAINT FKSTD_DOCUMENTSRCTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DOCUMENTSOURCETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DOCUMENTSOURCETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DOCUMENTSOURCETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DOCUMENTSOURCETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DOCUMENTSOURCETYPE ON SDSADM.STD_DOCUMENTSOURCETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DOCUMENTSOURCETYPECODE ON SDSADM.STD_DOCUMENTSOURCETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DOCUMENTSOURCETYPENAME ON SDSADM.STD_DOCUMENTSOURCETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DocumentSourceType
after DELETE
ON SDSADM.STD_DOCUMENTSOURCETYPE
BEGIN
	-- update the table for STD_DocumentSourceType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DocumentSourceType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DocumentSourceType
after INSERT
ON SDSADM.STD_DOCUMENTSOURCETYPE
BEGIN
	-- update the table for STD_DocumentSourceType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DocumentSourceType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DocumentSourceType
after UPDATE
ON SDSADM.STD_DOCUMENTSOURCETYPE
BEGIN
	-- update the table for STD_DocumentSourceType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DocumentSourceType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DOCUMENTSOURCETYPE FOR SDSADM.STD_DOCUMENTSOURCETYPE;


ALTER TABLE SDSADM.STD_DOCUMENTSOURCETYPE ADD (
  CONSTRAINT PK_STD_DOCUMENTSOURCETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DOCUMENTSOURCETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DOCUMENTSOURCETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DOCUMENTSOURCETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DOCUMENTSOURCETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DOCUMENTSOURCETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DOCUMENTSOURCETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DOCUMENTSOURCETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DOCUMENTSOURCETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DOCUMENTSOURCETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DISTRIBUTIONTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DISTRIBUTIONTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DISTRIBUTIONTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DISTRIBUTIONTYPEHISTORY ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DistributionTypeHstry
after DELETE
ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY
BEGIN
	-- update the table for STD_DistributionTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DistributionTypeHstry
after INSERT
ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY
BEGIN
	-- update the table for STD_DistributionTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DistributionTypeHstry
after UPDATE
ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY
BEGIN
	-- update the table for STD_DistributionTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DISTRIBUTIONTYPEHISTORY FOR SDSADM.STD_DISTRIBUTIONTYPEHISTORY;


ALTER TABLE SDSADM.STD_DISTRIBUTIONTYPEHISTORY ADD (
  CONSTRAINT PK_STD_DISTRIBUTIONTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DISTRIBUTIONTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DISTRIBUTIONTYPEHISTORY ADD (
  CONSTRAINT FKSTD_DISTRIBUTIONTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DISTRIBUTIONTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DISTRIBUTIONTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DISTRIBUTIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DISTRIBUTIONTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DISTRIBUTIONTYPE ON SDSADM.STD_DISTRIBUTIONTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DISTRIBUTIONTYPECODE ON SDSADM.STD_DISTRIBUTIONTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DISTRIBUTIONTYPENAME ON SDSADM.STD_DISTRIBUTIONTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DistributionType
after DELETE
ON SDSADM.STD_DISTRIBUTIONTYPE
BEGIN
	-- update the table for STD_DistributionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DistributionType
after INSERT
ON SDSADM.STD_DISTRIBUTIONTYPE
BEGIN
	-- update the table for STD_DistributionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DistributionType
after UPDATE
ON SDSADM.STD_DISTRIBUTIONTYPE
BEGIN
	-- update the table for STD_DistributionType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DISTRIBUTIONTYPE FOR SDSADM.STD_DISTRIBUTIONTYPE;


ALTER TABLE SDSADM.STD_DISTRIBUTIONTYPE ADD (
  CONSTRAINT PK_STD_DISTRIBUTIONTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DISTRIBUTIONTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DISTRIBUTIONTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DISTRIBUTIONTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DISTRIBUTIONTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DISTRIBUTIONTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DISTRIBUTIONTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DISTRIBUTIONTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DISTRIBUTIONTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DISTRIBUTIONCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DISTRIBUTIONCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DISTRIBUTIONCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DISTRIBUTIONCODEHISTORY ON SDSADM.STD_DISTRIBUTIONCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DistributionCodeHstry
after DELETE
ON SDSADM.STD_DISTRIBUTIONCODEHISTORY
BEGIN
	-- update the table for STD_DistributionCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DistributionCodeHstry
after INSERT
ON SDSADM.STD_DISTRIBUTIONCODEHISTORY
BEGIN
	-- update the table for STD_DistributionCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DistributionCodeHstry
after UPDATE
ON SDSADM.STD_DISTRIBUTIONCODEHISTORY
BEGIN
	-- update the table for STD_DistributionCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DISTRIBUTIONCODEHISTORY FOR SDSADM.STD_DISTRIBUTIONCODEHISTORY;


ALTER TABLE SDSADM.STD_DISTRIBUTIONCODEHISTORY ADD (
  CONSTRAINT PK_STD_DISTRIBUTIONCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DISTRIBUTIONCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DISTRIBUTIONCODEHISTORY ADD (
  CONSTRAINT FKSTD_DISTRIBUTIONCDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DISTRIBUTIONCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DISTRIBUTIONCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DISTRIBUTIONCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DISTRIBUTIONCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DISTRIBUTIONCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DISTRIBUTIONCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DISTRIBUTIONCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DISTRIBUTIONCODE ON SDSADM.STD_DISTRIBUTIONCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DISTRIBUTIONCODECODE ON SDSADM.STD_DISTRIBUTIONCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DISTRIBUTIONCODENAME ON SDSADM.STD_DISTRIBUTIONCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DistributionCode
after DELETE
ON SDSADM.STD_DISTRIBUTIONCODE
BEGIN
	-- update the table for STD_DistributionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DistributionCode
after INSERT
ON SDSADM.STD_DISTRIBUTIONCODE
BEGIN
	-- update the table for STD_DistributionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DistributionCode
after UPDATE
ON SDSADM.STD_DISTRIBUTIONCODE
BEGIN
	-- update the table for STD_DistributionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DistributionCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DISTRIBUTIONCODE FOR SDSADM.STD_DISTRIBUTIONCODE;


ALTER TABLE SDSADM.STD_DISTRIBUTIONCODE ADD (
  CONSTRAINT PK_STD_DISTRIBUTIONCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DISTRIBUTIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DISTRIBUTIONCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DISTRIBUTIONCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DISTRIBUTIONCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DISTRIBUTIONCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DISTRIBUTIONCODE TO ADR;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DISTRIBUTIONCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DISTRIBUTIONCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DISTRIBUTIONCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DISABILITYCONDITIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DISABILITYCONDITIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DISABILITYCONDITIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DISABILITYCNDTNHSTRY ON SDSADM.STD_DISABILITYCONDITIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DisabilityCndtnHstry
after DELETE
ON SDSADM.STD_DISABILITYCONDITIONHISTORY
BEGIN
	-- update the table for STD_DisabilityConditionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DisabilityConditionHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DisabilityCndtnHstry
after INSERT
ON SDSADM.STD_DISABILITYCONDITIONHISTORY
BEGIN
	-- update the table for STD_DisabilityConditionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DisabilityConditionHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DisabilityCndtnHstry
after UPDATE
ON SDSADM.STD_DISABILITYCONDITIONHISTORY
BEGIN
	-- update the table for STD_DisabilityConditionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DisabilityConditionHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DISABILITYCONDITIONHISTORY FOR SDSADM.STD_DISABILITYCONDITIONHISTORY;


ALTER TABLE SDSADM.STD_DISABILITYCONDITIONHISTORY ADD (
  CONSTRAINT PK_STD_DISABILITYCNDTNHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DISABILITYCNDTNHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DISABILITYCONDITIONHISTORY ADD (
  CONSTRAINT FKSTD_DISABILITYCNDTNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DISABILITYCONDITION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DISABILITYCONDITIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DISABILITYCONDITIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DISABILITYCONDITIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DISABILITYCONDITION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DISABILITYCONDITION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DISABILITYCONDITION
(
  ID           NUMBER(20)                       NOT NULL,
  IEN          NUMBER(10)                       NOT NULL,
  DXCODE       VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(200 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DISABILITYCONDITION ON SDSADM.STD_DISABILITYCONDITION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DISABILITYCONDITIONDXCD ON SDSADM.STD_DISABILITYCONDITION
(DXCODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DISABILITYCONDITIONIEN ON SDSADM.STD_DISABILITYCONDITION
(IEN)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DisabilityCondition
after DELETE
ON SDSADM.STD_DISABILITYCONDITION
BEGIN
	-- update the table for STD_DisabilityCondition operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DisabilityCondition';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DisabilityCondition
after INSERT
ON SDSADM.STD_DISABILITYCONDITION
BEGIN
	-- update the table for STD_DisabilityCondition operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DisabilityCondition';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DisabilityCondition
after UPDATE
ON SDSADM.STD_DISABILITYCONDITION
BEGIN
	-- update the table for STD_DisabilityCondition operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DisabilityCondition';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DISABILITYCONDITION FOR SDSADM.STD_DISABILITYCONDITION;


ALTER TABLE SDSADM.STD_DISABILITYCONDITION ADD (
  CONSTRAINT PK_STD_DISABILITYCONDITION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DISABILITYCONDITION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DISABILITYCONDITIONDXCD
  UNIQUE (DXCODE)
  USING INDEX SDSADM.UQSTD_DISABILITYCONDITIONDXCD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DISABILITYCONDITIONIEN
  UNIQUE (IEN)
  USING INDEX SDSADM.UQSTD_DISABILITYCONDITIONIEN
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DISABILITYCONDITION TO ADR;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITION TO ADREXT;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITION TO EESRV;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DISABILITYCONDITION TO LOBR;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DISABILITYCONDITION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DISABILITYCONDITION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DIAGNOSISTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DIAGNOSISTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DIAGNOSISTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DIAGNOSISTYPEHISTORY ON SDSADM.STD_DIAGNOSISTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DiagnosisTypeHistory
after DELETE
ON SDSADM.STD_DIAGNOSISTYPEHISTORY
BEGIN
	-- update the table for STD_DiagnosisTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DiagnosisTypeHistory
after INSERT
ON SDSADM.STD_DIAGNOSISTYPEHISTORY
BEGIN
	-- update the table for STD_DiagnosisTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DiagnosisTypeHistory
after UPDATE
ON SDSADM.STD_DIAGNOSISTYPEHISTORY
BEGIN
	-- update the table for STD_DiagnosisTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DIAGNOSISTYPEHISTORY FOR SDSADM.STD_DIAGNOSISTYPEHISTORY;


ALTER TABLE SDSADM.STD_DIAGNOSISTYPEHISTORY ADD (
  CONSTRAINT PK_STD_DIAGNOSISTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DIAGNOSISTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DIAGNOSISTYPEHISTORY ADD (
  CONSTRAINT FKSTD_DIAGNOSISTYPEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DIAGNOSISTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DIAGNOSISTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DIAGNOSISTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DIAGNOSISTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DIAGNOSISTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DIAGNOSISTYPE ON SDSADM.STD_DIAGNOSISTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DIAGNOSISTYPECODE ON SDSADM.STD_DIAGNOSISTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DIAGNOSISTYPENAME ON SDSADM.STD_DIAGNOSISTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DiagnosisType
after DELETE
ON SDSADM.STD_DIAGNOSISTYPE
BEGIN
	-- update the table for STD_DiagnosisType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DiagnosisType
after INSERT
ON SDSADM.STD_DIAGNOSISTYPE
BEGIN
	-- update the table for STD_DiagnosisType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DiagnosisType
after UPDATE
ON SDSADM.STD_DIAGNOSISTYPE
BEGIN
	-- update the table for STD_DiagnosisType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DIAGNOSISTYPE FOR SDSADM.STD_DIAGNOSISTYPE;


ALTER TABLE SDSADM.STD_DIAGNOSISTYPE ADD (
  CONSTRAINT PK_STD_DIAGNOSISTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DIAGNOSISTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DIAGNOSISTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DIAGNOSISTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DIAGNOSISTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DIAGNOSISTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DIAGNOSISTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DIAGNOSISTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DIAGNOSISCODSCHHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DIAGNOSISCODSCHHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DIAGNOSISCODSCHHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DIAGNOSISCODSCHHISTORY ON SDSADM.STD_DIAGNOSISCODSCHHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DiagnosisCodSchHstry
after DELETE
ON SDSADM.STD_DIAGNOSISCODSCHHISTORY
BEGIN
	-- update the table for STD_DiagnosisCodSchHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCodSchHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DiagnosisCodSchHstry
after INSERT
ON SDSADM.STD_DIAGNOSISCODSCHHISTORY
BEGIN
	-- update the table for STD_DiagnosisCodSchHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCodSchHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DiagnosisCodSchHstry
after UPDATE
ON SDSADM.STD_DIAGNOSISCODSCHHISTORY
BEGIN
	-- update the table for STD_DiagnosisCodSchHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCodSchHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DIAGNOSISCODSCHHISTORY FOR SDSADM.STD_DIAGNOSISCODSCHHISTORY;


ALTER TABLE SDSADM.STD_DIAGNOSISCODSCHHISTORY ADD (
  CONSTRAINT PK_STD_DIAGNOSISCODSCHHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DIAGNOSISCODSCHHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DIAGNOSISCODSCHHISTORY ADD (
  CONSTRAINT FKSTD_DIAGNOSISCODSCHHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DIAGNOSISCODSCH (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISCODSCHHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCHHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCHHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCHHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISCODSCHHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCHHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DIAGNOSISCODSCHHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCHHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCHHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DIAGNOSISCODSCH
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DIAGNOSISCODSCH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DIAGNOSISCODSCH
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(6 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(200 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DIAGNOSISCODSCH ON SDSADM.STD_DIAGNOSISCODSCH
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DIAGNOSISCODSCHCODE ON SDSADM.STD_DIAGNOSISCODSCH
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DIAGNOSISCODSCHNAME ON SDSADM.STD_DIAGNOSISCODSCH
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DiagnosisCodSch
after DELETE
ON SDSADM.STD_DIAGNOSISCODSCH
BEGIN
	-- update the table for STD_DiagnosisCodSch operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCodSch';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DiagnosisCodSch
after INSERT
ON SDSADM.STD_DIAGNOSISCODSCH
BEGIN
	-- update the table for STD_DiagnosisCodSch operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCodSch';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DiagnosisCodSch
after UPDATE
ON SDSADM.STD_DIAGNOSISCODSCH
BEGIN
	-- update the table for STD_DiagnosisCodSch operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCodSch';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DIAGNOSISCODSCH FOR SDSADM.STD_DIAGNOSISCODSCH;


ALTER TABLE SDSADM.STD_DIAGNOSISCODSCH ADD (
  CONSTRAINT PK_STD_DIAGNOSISCODSCH
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DIAGNOSISCODSCH
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DIAGNOSISCODSCHCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DIAGNOSISCODSCHCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DIAGNOSISCODSCHNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DIAGNOSISCODSCHNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISCODSCH TO ADR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCH TO ADREXT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCH TO EESRV;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCH TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISCODSCH TO LOBR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCH TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DIAGNOSISCODSCH TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCH TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODSCH TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DIAGNOSISCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DIAGNOSISCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DIAGNOSISCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DIAGNOSISCODEHISTORY ON SDSADM.STD_DIAGNOSISCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DiagnosisCodeHistory
after DELETE
ON SDSADM.STD_DIAGNOSISCODEHISTORY
BEGIN
	-- update the table for STD_DiagnosisCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DiagnosisCodeHistory
after INSERT
ON SDSADM.STD_DIAGNOSISCODEHISTORY
BEGIN
	-- update the table for STD_DiagnosisCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DiagnosisCodeHistory
after UPDATE
ON SDSADM.STD_DIAGNOSISCODEHISTORY
BEGIN
	-- update the table for STD_DiagnosisCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DIAGNOSISCODEHISTORY FOR SDSADM.STD_DIAGNOSISCODEHISTORY;


ALTER TABLE SDSADM.STD_DIAGNOSISCODEHISTORY ADD (
  CONSTRAINT PK_STD_DIAGNOSISCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DIAGNOSISCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DIAGNOSISCODEHISTORY ADD (
  CONSTRAINT FKSTD_DIAGNOSISCODEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DIAGNOSISCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DIAGNOSISCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DIAGNOSISCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DIAGNOSISCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DIAGNOSISCODE
(
  ID            NUMBER(20)                      NOT NULL,
  CODE          VARCHAR2(6 BYTE)                NOT NULL,
  NAME          VARCHAR2(60 BYTE)               NOT NULL,
  CODESET_TYPE  VARCHAR2(6 BYTE)                NOT NULL,
  DESCRIPTION   VARCHAR2(100 BYTE),
  VERSION       INTEGER                         NOT NULL,
  CREATED       TIMESTAMP(6)                    NOT NULL,
  UPDATED       TIMESTAMP(6),
  CREATEDBY     VARCHAR2(32 BYTE)               NOT NULL,
  UPDATEDBY     VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DIAGNOSISCODE ON SDSADM.STD_DIAGNOSISCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DIAGNOSISCODECODE ON SDSADM.STD_DIAGNOSISCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DIAGNOSISCODENAME ON SDSADM.STD_DIAGNOSISCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DiagnosisCode
after DELETE
ON SDSADM.STD_DIAGNOSISCODE
BEGIN
	-- update the table for STD_DiagnosisCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DiagnosisCode
after INSERT
ON SDSADM.STD_DIAGNOSISCODE
BEGIN
	-- update the table for STD_DiagnosisCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DiagnosisCode
after UPDATE
ON SDSADM.STD_DIAGNOSISCODE
BEGIN
	-- update the table for STD_DiagnosisCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DiagnosisCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DIAGNOSISCODE FOR SDSADM.STD_DIAGNOSISCODE;


ALTER TABLE SDSADM.STD_DIAGNOSISCODE ADD (
  CONSTRAINT PK_STD_DIAGNOSISCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DIAGNOSISCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DIAGNOSISCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DIAGNOSISCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DIAGNOSISCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DIAGNOSISCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISCODE TO ADR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DIAGNOSISCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DIAGNOSISCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DIAGNOSISCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DETAILEDINCOMETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DETAILEDINCOMETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DETAILEDINCOMETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DETAILEDINCOMETYPEHSTRY ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DetailedIncmTypHstry
after DELETE
ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY
BEGIN
	-- update the table for STD_DetailedIncomeTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncomeTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DetailedIncmTypHstry
after INSERT
ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY
BEGIN
	-- update the table for STD_DetailedIncomeTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncomeTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DetailedIncmTypHstry
after UPDATE
ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY
BEGIN
	-- update the table for STD_DetailedIncomeTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncomeTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DETAILEDINCOMETYPEHISTORY FOR SDSADM.STD_DETAILEDINCOMETYPEHISTORY;


ALTER TABLE SDSADM.STD_DETAILEDINCOMETYPEHISTORY ADD (
  CONSTRAINT PK_STD_DETAILEDINCOMETYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DETAILEDINCOMETYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DETAILEDINCOMETYPEHISTORY ADD (
  CONSTRAINT FKSTD_DETAILEDINCMTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DETAILEDINCOMETYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DETAILEDINCOMETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DETAILEDINCOMETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DETAILEDINCOMETYPE
(
  ID                      NUMBER(20)            NOT NULL,
  CODE                    VARCHAR2(3 BYTE)      NOT NULL,
  NAME                    VARCHAR2(80 BYTE)     NOT NULL,
  EARNED_INCOME           NUMBER(10),
  INCOME_SUMMARY_TYPE_ID  NUMBER(10),
  DESCRIPTION             VARCHAR2(250 BYTE),
  VERSION                 INTEGER               NOT NULL,
  CREATED                 TIMESTAMP(6)          NOT NULL,
  UPDATED                 TIMESTAMP(6),
  CREATEDBY               VARCHAR2(32 BYTE)     NOT NULL,
  UPDATEDBY               VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DETAILEDINCOMETYPE ON SDSADM.STD_DETAILEDINCOMETYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DETAILEDINCOMETYPECODE ON SDSADM.STD_DETAILEDINCOMETYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DETAILEDINCOMETYPENAME ON SDSADM.STD_DETAILEDINCOMETYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DetailedIncomeType
after DELETE
ON SDSADM.STD_DETAILEDINCOMETYPE
BEGIN
	-- update the table for STD_DetailedIncomeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncomeType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DetailedIncomeType
after INSERT
ON SDSADM.STD_DETAILEDINCOMETYPE
BEGIN
	-- update the table for STD_DetailedIncomeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncomeType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DetailedIncomeType
after UPDATE
ON SDSADM.STD_DETAILEDINCOMETYPE
BEGIN
	-- update the table for STD_DetailedIncomeType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncomeType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DETAILEDINCOMETYPE FOR SDSADM.STD_DETAILEDINCOMETYPE;


ALTER TABLE SDSADM.STD_DETAILEDINCOMETYPE ADD (
  CONSTRAINT PK_STD_DETAILEDINCOMETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DETAILEDINCOMETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DETAILEDINCOMETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DETAILEDINCOMETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DETAILEDINCOMETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DETAILEDINCOMETYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DETAILEDINCOMETYPE TO ADR;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DETAILEDINCOMETYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DETAILEDINCOMETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DETAILEDINCOMETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DETAILEDINCFINDOCHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DETAILEDINCFINDOCHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DETAILEDINCFINDOCHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DETAILEDINCFINDOCHSTRY ON SDSADM.STD_DETAILEDINCFINDOCHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DetailedIncFinDcHstry
after DELETE
ON SDSADM.STD_DETAILEDINCFINDOCHISTORY
BEGIN
	-- update the table for STD_DetailedIncFinDocHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncFinDocHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DetailedIncFinDcHstry
after INSERT
ON SDSADM.STD_DETAILEDINCFINDOCHISTORY
BEGIN
	-- update the table for STD_DetailedIncFinDocHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncFinDocHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DetailedIncFinDcHstry
after UPDATE
ON SDSADM.STD_DETAILEDINCFINDOCHISTORY
BEGIN
	-- update the table for STD_DetailedIncFinDocHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncFinDocHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DETAILEDINCFINDOCHISTORY FOR SDSADM.STD_DETAILEDINCFINDOCHISTORY;


ALTER TABLE SDSADM.STD_DETAILEDINCFINDOCHISTORY ADD (
  CONSTRAINT PK_STD_DETAILEDINCFINDOCHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DETAILEDINCFINDOCHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DETAILEDINCFINDOCHISTORY ADD (
  CONSTRAINT FKSTD_DETAILEDINCFNDCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DETAILEDINCFINDOC (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DETAILEDINCFINDOCHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOCHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOCHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOCHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DETAILEDINCFINDOCHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOCHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DETAILEDINCFINDOCHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOCHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOCHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DETAILEDINCFINDOC
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DETAILEDINCFINDOC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DETAILEDINCFINDOC
(
  ID                     NUMBER(20)             NOT NULL,
  DETAILEDINCOMETYPE_ID  NUMBER(20)             NOT NULL,
  FINANCIALDOCUMTYPE_ID  NUMBER(20)             NOT NULL,
  VERSION                INTEGER                NOT NULL,
  CREATED                TIMESTAMP(6)           NOT NULL,
  UPDATED                TIMESTAMP(6),
  CREATEDBY              VARCHAR2(32 BYTE)      NOT NULL,
  UPDATEDBY              VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DETAILEDINCFINDOC ON SDSADM.STD_DETAILEDINCFINDOC
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DetailedIncFinDoc
after DELETE
ON SDSADM.STD_DETAILEDINCFINDOC
BEGIN
	-- update the table for STD_DetailedIncFinDoc operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncFinDoc';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DetailedIncFinDoc
after INSERT
ON SDSADM.STD_DETAILEDINCFINDOC
BEGIN
	-- update the table for STD_DetailedIncFinDoc operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncFinDoc';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DetailedIncFinDoc
after UPDATE
ON SDSADM.STD_DETAILEDINCFINDOC
BEGIN
	-- update the table for STD_DetailedIncFinDoc operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DetailedIncFinDoc';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DETAILEDINCFINDOC FOR SDSADM.STD_DETAILEDINCFINDOC;


ALTER TABLE SDSADM.STD_DETAILEDINCFINDOC ADD (
  CONSTRAINT PK_STD_DETAILEDINCFINDOC
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DETAILEDINCFINDOC
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DETAILEDINCFINDOC ADD (
  CONSTRAINT FKSTD_DTLDINCFNDCDTLDINCMTYP 
  FOREIGN KEY (DETAILEDINCOMETYPE_ID) 
  REFERENCES SDSADM.STD_DETAILEDINCOMETYPE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_DTLDINCFNDCFNNCLDCMTYP 
  FOREIGN KEY (FINANCIALDOCUMTYPE_ID) 
  REFERENCES SDSADM.STD_FINANCIALDOCUMTYPE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DETAILEDINCFINDOC TO ADR;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOC TO ADREXT;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOC TO EESRV;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOC TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DETAILEDINCFINDOC TO LOBR;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOC TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DETAILEDINCFINDOC TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOC TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DETAILEDINCFINDOC TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DESCRIPTORCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DESCRIPTORCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DESCRIPTORCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DESCRIPTORCODESHISTORY ON SDSADM.STD_DESCRIPTORCODEHISTORY
(ID)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DescriptorCodesHstry
after DELETE
ON SDSADM.STD_DESCRIPTORCODEHISTORY
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DescriptorCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DescriptorCodesHstry
after INSERT
ON SDSADM.STD_DESCRIPTORCODEHISTORY
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DescriptorCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DescriptorCodesHstry
after UPDATE
ON SDSADM.STD_DESCRIPTORCODEHISTORY
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DescriptorCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DESCRIPTORCODEHISTORY FOR SDSADM.STD_DESCRIPTORCODEHISTORY;


ALTER TABLE SDSADM.STD_DESCRIPTORCODEHISTORY ADD (
  CONSTRAINT PK_STD_DESCRIPTORCODESHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DESCRIPTORCODESHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DESCRIPTORCODEHISTORY ADD (
  CONSTRAINT FKSTD_DESCRIPTORCODESHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DESCRIPTORCODE (ID)
  ON DELETE CASCADE
  ENABLE VALIDATE);

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DESCRIPTORCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DESCRIPTORCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DESCRIPTORCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DESCRIPTORCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DESCRIPTORCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DESCRIPTORCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(10 BYTE)                NOT NULL,
  NAME         VARCHAR2(100 BYTE)               NOT NULL,
  DESCRIPTION  VARCHAR2(300 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DESCRIPTORCODES ON SDSADM.STD_DESCRIPTORCODE
(ID)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DESCRIPTORCODESCODE ON SDSADM.STD_DESCRIPTORCODE
(CODE)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DESCRIPTORCODESNAME ON SDSADM.STD_DESCRIPTORCODE
(NAME)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DescriptorCodes
after DELETE
ON SDSADM.STD_DESCRIPTORCODE
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DescriptorCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DescriptorCodes
after INSERT
ON SDSADM.STD_DESCRIPTORCODE
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DescriptorCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DescriptorCodes
after UPDATE
ON SDSADM.STD_DESCRIPTORCODE
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DescriptorCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DESCRIPTORCODE FOR SDSADM.STD_DESCRIPTORCODE;


ALTER TABLE SDSADM.STD_DESCRIPTORCODE ADD (
  CONSTRAINT PK_STD_DESCRIPTORCODES
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DESCRIPTORCODES
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DESCRIPTORCODESCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DESCRIPTORCODESCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DESCRIPTORCODESNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DESCRIPTORCODESNAME
  ENABLE VALIDATE);

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DESCRIPTORCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DESCRIPTORCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DESCRIPTORCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DELIVERYSRCTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DELIVERYSRCTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DELIVERYSRCTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DELIVERYSRCTYPEHISTORY ON SDSADM.STD_DELIVERYSRCTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DELIVERYSRCTYPEHstry
after DELETE
ON SDSADM.STD_DELIVERYSRCTYPEHISTORY
BEGIN
	-- update the table for STD_DELIVERYSRCTYPEHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYSRCTYPEHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DELIVERYSRCTYPEHstry
after INSERT
ON SDSADM.STD_DELIVERYSRCTYPEHISTORY
BEGIN
	-- update the table for STD_DELIVERYSRCTYPEHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYSRCTYPEHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DELIVERYSRCTYPEHstry
after UPDATE
ON SDSADM.STD_DELIVERYSRCTYPEHISTORY
BEGIN
	-- update the table for STD_DELIVERYSRCTYPEHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYSRCTYPEHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DELIVERYSRCTYPEHISTORY FOR SDSADM.STD_DELIVERYSRCTYPEHISTORY;


ALTER TABLE SDSADM.STD_DELIVERYSRCTYPEHISTORY ADD (
  CONSTRAINT PK_STD_DELIVERYSRCTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DELIVERYSRCTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DELIVERYSRCTYPEHISTORY ADD (
  CONSTRAINT FKSTD_DELIVERYSRCTYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DELIVERYSRCTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DELIVERYSRCTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DELIVERYSRCTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DELIVERYSRCTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DELIVERYSRCTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DELIVERYSRCTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DELIVERYSRCTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DELIVERYSRCTYPE ON SDSADM.STD_DELIVERYSRCTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DELIVERYSRCTYPECODE ON SDSADM.STD_DELIVERYSRCTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DELIVERYSRCTYPENAME ON SDSADM.STD_DELIVERYSRCTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DELIVERYSRCTYPE
after DELETE
ON SDSADM.STD_DELIVERYSRCTYPE
BEGIN
	-- update the table for STD_DELIVERYSRCTYPE operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYSRCTYPE';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DELIVERYSRCTYPE
after INSERT
ON SDSADM.STD_DELIVERYSRCTYPE
BEGIN
	-- update the table for STD_DELIVERYSRCTYPE operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYSRCTYPE';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DELIVERYSRCTYPE
after UPDATE
ON SDSADM.STD_DELIVERYSRCTYPE
BEGIN
	-- update the table for STD_DELIVERYSRCTYPE operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYSRCTYPE';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DELIVERYSRCTYPE FOR SDSADM.STD_DELIVERYSRCTYPE;


ALTER TABLE SDSADM.STD_DELIVERYSRCTYPE ADD (
  CONSTRAINT PK_STD_DELIVERYSRCTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DELIVERYSRCTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DELIVERYSRCTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DELIVERYSRCTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DELIVERYSRCTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DELIVERYSRCTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DELIVERYSRCTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DELIVERYSRCTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DELIVERYSRCTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DELIVERYSRCTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DELIVERYPREFTYPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DELIVERYPREFTYPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DELIVERYPREFTYPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DELIVERYPREFTYPHISTORY ON SDSADM.STD_DELIVERYPREFTYPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DELIVERYPREFTYPHstry
after DELETE
ON SDSADM.STD_DELIVERYPREFTYPHISTORY
BEGIN
	-- update the table for STD_DELIVERYPREFTYPHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYPREFTYPHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DELIVERYPREFTYPHstry
after INSERT
ON SDSADM.STD_DELIVERYPREFTYPHISTORY
BEGIN
	-- update the table for STD_DELIVERYPREFTYPHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYPREFTYPHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DELIVERYPREFTYPHstry
after UPDATE
ON SDSADM.STD_DELIVERYPREFTYPHISTORY
BEGIN
	-- update the table for STD_DELIVERYPREFTYPHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYPREFTYPHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DELIVERYPREFTYPHISTORY FOR SDSADM.STD_DELIVERYPREFTYPHISTORY;


ALTER TABLE SDSADM.STD_DELIVERYPREFTYPHISTORY ADD (
  CONSTRAINT PK_STD_DELIVERYPREFTYPHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DELIVERYPREFTYPHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DELIVERYPREFTYPHISTORY ADD (
  CONSTRAINT FKSTD_DELIVERYPREFTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DELIVERYPREFTYP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DELIVERYPREFTYPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DELIVERYPREFTYPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DELIVERYPREFTYPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DELIVERYPREFTYP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DELIVERYPREFTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DELIVERYPREFTYP
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DELIVERYPREFTYP ON SDSADM.STD_DELIVERYPREFTYP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DELIVERYPREFTYPCODE ON SDSADM.STD_DELIVERYPREFTYP
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DELIVERYPREFTYPNAME ON SDSADM.STD_DELIVERYPREFTYP
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DELIVERYPREFTYP
after DELETE
ON SDSADM.STD_DELIVERYPREFTYP
BEGIN
	-- update the table for STD_DELIVERYPREFTYP operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYPREFTYP';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DELIVERYPREFTYP
after INSERT
ON SDSADM.STD_DELIVERYPREFTYP
BEGIN
	-- update the table for STD_DELIVERYPREFTYP operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYPREFTYP';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DELIVERYPREFTYP
after UPDATE
ON SDSADM.STD_DELIVERYPREFTYP
BEGIN
	-- update the table for STD_DELIVERYPREFTYP operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DELIVERYPREFTYP';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DELIVERYPREFTYP FOR SDSADM.STD_DELIVERYPREFTYP;


ALTER TABLE SDSADM.STD_DELIVERYPREFTYP ADD (
  CONSTRAINT PK_STD_DELIVERYPREFTYP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DELIVERYPREFTYP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DELIVERYPREFTYPCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DELIVERYPREFTYPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DELIVERYPREFTYPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DELIVERYPREFTYPNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DELIVERYPREFTYP TO ADR;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYP TO ADREXT;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYP TO EESRV;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DELIVERYPREFTYP TO LOBR;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DELIVERYPREFTYP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DELIVERYPREFTYP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DEGREEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DEGREEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DEGREEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DEGREEHISTORY ON SDSADM.STD_DEGREEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DegreeHistory
after DELETE
ON SDSADM.STD_DEGREEHISTORY
BEGIN
	-- update the table for STD_DegreeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DegreeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DegreeHistory
after INSERT
ON SDSADM.STD_DEGREEHISTORY
BEGIN
	-- update the table for STD_DegreeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DegreeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DegreeHistory
after UPDATE
ON SDSADM.STD_DEGREEHISTORY
BEGIN
	-- update the table for STD_DegreeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DegreeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DEGREEHISTORY FOR SDSADM.STD_DEGREEHISTORY;


ALTER TABLE SDSADM.STD_DEGREEHISTORY ADD (
  CONSTRAINT PK_STD_DEGREEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DEGREEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DEGREEHISTORY ADD (
  CONSTRAINT FKSTD_DEGREEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DEGREE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DEGREEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DEGREEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DEGREEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DEGREEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DEGREEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DEGREEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DEGREEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DEGREEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DEGREEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DEGREE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DEGREE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DEGREE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(10 BYTE)                NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DEGREE ON SDSADM.STD_DEGREE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DEGREECODE ON SDSADM.STD_DEGREE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DEGREENAME ON SDSADM.STD_DEGREE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Degree
after DELETE
ON SDSADM.STD_DEGREE
BEGIN
	-- update the table for STD_Degree operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Degree';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Degree
after INSERT
ON SDSADM.STD_DEGREE
BEGIN
	-- update the table for STD_Degree operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Degree';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Degree
after UPDATE
ON SDSADM.STD_DEGREE
BEGIN
	-- update the table for STD_Degree operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Degree';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DEGREE FOR SDSADM.STD_DEGREE;


ALTER TABLE SDSADM.STD_DEGREE ADD (
  CONSTRAINT PK_STD_DEGREE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DEGREE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DEGREECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DEGREECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DEGREENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DEGREENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DEGREE TO ADR;

GRANT SELECT ON SDSADM.STD_DEGREE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DEGREE TO EESRV;

GRANT SELECT ON SDSADM.STD_DEGREE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DEGREE TO LOBR;

GRANT SELECT ON SDSADM.STD_DEGREE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DEGREE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DEGREE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DEGREE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DECORATNDOCTYPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DECORATNDOCTYPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DECORATNDOCTYPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DECORATNDOCTYPHISTORY ON SDSADM.STD_DECORATNDOCTYPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DecoratnDocTypHistory
after DELETE
ON SDSADM.STD_DECORATNDOCTYPHISTORY
BEGIN
	-- update the table for STD_DecoratnDocTypHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecoratnDocTypHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DecoratnDocTypHistory
after INSERT
ON SDSADM.STD_DECORATNDOCTYPHISTORY
BEGIN
	-- update the table for STD_DecoratnDocTypHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecoratnDocTypHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DecoratnDocTypHistory
after UPDATE
ON SDSADM.STD_DECORATNDOCTYPHISTORY
BEGIN
	-- update the table for STD_DecoratnDocTypHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecoratnDocTypHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DECORATNDOCTYPHISTORY FOR SDSADM.STD_DECORATNDOCTYPHISTORY;


ALTER TABLE SDSADM.STD_DECORATNDOCTYPHISTORY ADD (
  CONSTRAINT PK_STD_DECORATNDOCTYPHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DECORATNDOCTYPHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DECORATNDOCTYPHISTORY ADD (
  CONSTRAINT FKSTD_DECORATNDOCTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DECORATIONDOCUMENTTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DECORATNDOCTYPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DECORATNDOCTYPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DECORATNDOCTYPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DECORATNDOCTYPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DECORATNDOCTYPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DECORATNDOCTYPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DECORATNDOCTYPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DECORATNDOCTYPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DECORATNDOCTYPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DECORATIONTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DECORATIONTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DECORATIONTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DECORATIONTYPEHISTORY ON SDSADM.STD_DECORATIONTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DecorationTypeHistory
after DELETE
ON SDSADM.STD_DECORATIONTYPEHISTORY
BEGIN
	-- update the table for STD_DecorationTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DecorationTypeHistory
after INSERT
ON SDSADM.STD_DECORATIONTYPEHISTORY
BEGIN
	-- update the table for STD_DecorationTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DecorationTypeHistory
after UPDATE
ON SDSADM.STD_DECORATIONTYPEHISTORY
BEGIN
	-- update the table for STD_DecorationTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DECORATIONTYPEHISTORY FOR SDSADM.STD_DECORATIONTYPEHISTORY;


ALTER TABLE SDSADM.STD_DECORATIONTYPEHISTORY ADD (
  CONSTRAINT PK_STD_DECORATIONTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DECORATIONTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DECORATIONTYPEHISTORY ADD (
  CONSTRAINT FKSTD_DECORATIONTYPEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DECORATIONTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DECORATIONTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DECORATIONTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DECORATIONTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DECORATIONTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DECORATIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DECORATIONTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DECORATIONTYPE ON SDSADM.STD_DECORATIONTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DECORATIONTYPECODE ON SDSADM.STD_DECORATIONTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DECORATIONTYPENAME ON SDSADM.STD_DECORATIONTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DecorationType
after DELETE
ON SDSADM.STD_DECORATIONTYPE
BEGIN
	-- update the table for STD_DecorationType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DecorationType
after INSERT
ON SDSADM.STD_DECORATIONTYPE
BEGIN
	-- update the table for STD_DecorationType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DecorationType
after UPDATE
ON SDSADM.STD_DECORATIONTYPE
BEGIN
	-- update the table for STD_DecorationType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DECORATIONTYPE FOR SDSADM.STD_DECORATIONTYPE;


ALTER TABLE SDSADM.STD_DECORATIONTYPE ADD (
  CONSTRAINT PK_STD_DECORATIONTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DECORATIONTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DECORATIONTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DECORATIONTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DECORATIONTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DECORATIONTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DECORATIONTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DECORATIONTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DECORATIONTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DECORATIONTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DECORATIONSTATUSHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DECORATIONSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DECORATIONSTATUSHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DECORATIONSTATUSHISTORY ON SDSADM.STD_DECORATIONSTATUSHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DecorationStatusHstry
after DELETE
ON SDSADM.STD_DECORATIONSTATUSHISTORY
BEGIN
	-- update the table for STD_DecorationStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DecorationStatusHstry
after INSERT
ON SDSADM.STD_DECORATIONSTATUSHISTORY
BEGIN
	-- update the table for STD_DecorationStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationStatusHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DecorationStatusHstry
after UPDATE
ON SDSADM.STD_DECORATIONSTATUSHISTORY
BEGIN
	-- update the table for STD_DecorationStatusHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationStatusHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DECORATIONSTATUSHISTORY FOR SDSADM.STD_DECORATIONSTATUSHISTORY;


ALTER TABLE SDSADM.STD_DECORATIONSTATUSHISTORY ADD (
  CONSTRAINT PK_STD_DECORATIONSTATUSHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DECORATIONSTATUSHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DECORATIONSTATUSHISTORY ADD (
  CONSTRAINT FKSTD_DECORATIONSTTSHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DECORATIONSTATUS (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DECORATIONSTATUSHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUSHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUSHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUSHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DECORATIONSTATUSHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUSHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DECORATIONSTATUSHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUSHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUSHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DECORATIONSTATUS
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DECORATIONSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DECORATIONSTATUS
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DECORATIONSTATUS ON SDSADM.STD_DECORATIONSTATUS
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DECORATIONSTATUSCODE ON SDSADM.STD_DECORATIONSTATUS
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DECORATIONSTATUSNAME ON SDSADM.STD_DECORATIONSTATUS
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DecorationStatus
after DELETE
ON SDSADM.STD_DECORATIONSTATUS
BEGIN
	-- update the table for STD_DecorationStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DecorationStatus
after INSERT
ON SDSADM.STD_DECORATIONSTATUS
BEGIN
	-- update the table for STD_DecorationStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationStatus';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DecorationStatus
after UPDATE
ON SDSADM.STD_DECORATIONSTATUS
BEGIN
	-- update the table for STD_DecorationStatus operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationStatus';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DECORATIONSTATUS FOR SDSADM.STD_DECORATIONSTATUS;


ALTER TABLE SDSADM.STD_DECORATIONSTATUS ADD (
  CONSTRAINT PK_STD_DECORATIONSTATUS
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DECORATIONSTATUS
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DECORATIONSTATUSCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DECORATIONSTATUSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DECORATIONSTATUSNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DECORATIONSTATUSNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DECORATIONSTATUS TO ADR;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUS TO ADREXT;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUS TO EESRV;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUS TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DECORATIONSTATUS TO LOBR;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUS TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DECORATIONSTATUS TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUS TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DECORATIONSTATUS TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DECORATIONDOCUMENTTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DECORATIONDOCUMENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DECORATIONDOCUMENTTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DECORATNDOCTYP ON SDSADM.STD_DECORATIONDOCUMENTTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DECORATNDOCTYPCODE ON SDSADM.STD_DECORATIONDOCUMENTTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DECORATNDOCTYPNAME ON SDSADM.STD_DECORATIONDOCUMENTTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DecoratnDocTyp
after DELETE
ON SDSADM.STD_DECORATIONDOCUMENTTYPE
BEGIN
	-- update the table for STD_DecorationDocumentType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationDocumentType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DecoratnDocTyp
after INSERT
ON SDSADM.STD_DECORATIONDOCUMENTTYPE
BEGIN
	-- update the table for STD_DecorationDocumentType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationDocumentType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DecoratnDocTyp
after UPDATE
ON SDSADM.STD_DECORATIONDOCUMENTTYPE
BEGIN
	-- update the table for STD_DecorationDocumentType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DecorationDocumentType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DECORATIONDOCUMENTTYPE FOR SDSADM.STD_DECORATIONDOCUMENTTYPE;


ALTER TABLE SDSADM.STD_DECORATIONDOCUMENTTYPE ADD (
  CONSTRAINT PK_STD_DECORATNDOCTYP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DECORATNDOCTYP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DECORATNDOCTYPCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DECORATNDOCTYPCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DECORATNDOCTYPNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DECORATNDOCTYPNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DECORATIONDOCUMENTTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_DECORATIONDOCUMENTTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DECORATIONDOCUMENTTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_DECORATIONDOCUMENTTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DECORATIONDOCUMENTTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_DECORATIONDOCUMENTTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DECORATIONDOCUMENTTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DECORATIONDOCUMENTTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DECORATIONDOCUMENTTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DEATHNOTIFICATIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DEATHNOTIFICATIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DEATHNOTIFICATIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DEATHNOTIFICATIONHSTRY ON SDSADM.STD_DEATHNOTIFICATIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DeathNtfctnHstry
after DELETE
ON SDSADM.STD_DEATHNOTIFICATIONHISTORY
BEGIN
	-- update the table for STD_DeathNotificationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DeathNotificationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DeathNtfctnHstry
after INSERT
ON SDSADM.STD_DEATHNOTIFICATIONHISTORY
BEGIN
	-- update the table for STD_DeathNotificationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DeathNotificationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DeathNtfctnHstry
after UPDATE
ON SDSADM.STD_DEATHNOTIFICATIONHISTORY
BEGIN
	-- update the table for STD_DeathNotificationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DeathNotificationHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DEATHNOTIFICATIONHISTORY FOR SDSADM.STD_DEATHNOTIFICATIONHISTORY;


ALTER TABLE SDSADM.STD_DEATHNOTIFICATIONHISTORY ADD (
  CONSTRAINT PK_STD_DEATHNOTIFICATIONHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DEATHNOTIFICATIONHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DEATHNOTIFICATIONHISTORY ADD (
  CONSTRAINT FKSTD_DEATHNTFCTNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DEATHNOTIFICATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DEATHNOTIFICATIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DEATHNOTIFICATIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DEATHNOTIFICATIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DEATHNOTIFICATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DEATHNOTIFICATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DEATHNOTIFICATION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DEATHNOTIFICATION ON SDSADM.STD_DEATHNOTIFICATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DEATHNOTIFICATIONCODE ON SDSADM.STD_DEATHNOTIFICATION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DEATHNOTIFICATIONNAME ON SDSADM.STD_DEATHNOTIFICATION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DeathNotification
after DELETE
ON SDSADM.STD_DEATHNOTIFICATION
BEGIN
	-- update the table for STD_DeathNotification operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DeathNotification';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DeathNotification
after INSERT
ON SDSADM.STD_DEATHNOTIFICATION
BEGIN
	-- update the table for STD_DeathNotification operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DeathNotification';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DeathNotification
after UPDATE
ON SDSADM.STD_DEATHNOTIFICATION
BEGIN
	-- update the table for STD_DeathNotification operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DeathNotification';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DEATHNOTIFICATION FOR SDSADM.STD_DEATHNOTIFICATION;


ALTER TABLE SDSADM.STD_DEATHNOTIFICATION ADD (
  CONSTRAINT PK_STD_DEATHNOTIFICATION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DEATHNOTIFICATION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DEATHNOTIFICATIONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DEATHNOTIFICATIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DEATHNOTIFICATIONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DEATHNOTIFICATIONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DEATHNOTIFICATION TO ADR;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATION TO EESRV;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DEATHNOTIFICATION TO LOBR;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DEATHNOTIFICATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DEATHNOTIFICATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DATACOLLECTJOBTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DATACOLLECTJOBTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DATACOLLECTJOBTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DATACOLLECTJOBTYPEHSTRY ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DataCollectJbTypHstry
after DELETE
ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY
BEGIN
	-- update the table for STD_DataCollectJobTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataCollectJobTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DataCollectJbTypHstry
after INSERT
ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY
BEGIN
	-- update the table for STD_DataCollectJobTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataCollectJobTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DataCollectJbTypHstry
after UPDATE
ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY
BEGIN
	-- update the table for STD_DataCollectJobTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataCollectJobTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DATACOLLECTJOBTYPEHISTORY FOR SDSADM.STD_DATACOLLECTJOBTYPEHISTORY;


ALTER TABLE SDSADM.STD_DATACOLLECTJOBTYPEHISTORY ADD (
  CONSTRAINT PK_STD_DATACOLLECTJOBTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DATACOLLECTJOBTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DATACOLLECTJOBTYPEHISTORY ADD (
  CONSTRAINT FKSTD_DATACLLCTJBTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DATACOLLECTJOBTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DATACOLLECTJOBTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DATACOLLECTJOBTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DATACOLLECTJOBTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DATACOLLECTJOBTYPE ON SDSADM.STD_DATACOLLECTJOBTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DATACOLLECTJOBTYPECODE ON SDSADM.STD_DATACOLLECTJOBTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DATACOLLECTJOBTYPENAME ON SDSADM.STD_DATACOLLECTJOBTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DataCollectJobType
after DELETE
ON SDSADM.STD_DATACOLLECTJOBTYPE
BEGIN
	-- update the table for STD_DataCollectJobType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataCollectJobType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DataCollectJobType
after INSERT
ON SDSADM.STD_DATACOLLECTJOBTYPE
BEGIN
	-- update the table for STD_DataCollectJobType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataCollectJobType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DataCollectJobType
after UPDATE
ON SDSADM.STD_DATACOLLECTJOBTYPE
BEGIN
	-- update the table for STD_DataCollectJobType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataCollectJobType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DATACOLLECTJOBTYPE FOR SDSADM.STD_DATACOLLECTJOBTYPE;


ALTER TABLE SDSADM.STD_DATACOLLECTJOBTYPE ADD (
  CONSTRAINT PK_STD_DATACOLLECTJOBTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DATACOLLECTJOBTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DATACOLLECTJOBTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DATACOLLECTJOBTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DATACOLLECTJOBTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DATACOLLECTJOBTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DATACOLLECTJOBTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DATACOLLECTJOBTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DATACOLLECTJOBTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DATACOLLECTJOBTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DATACHANGESOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DATACHANGESOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DATACHANGESOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DATACHANGESOURCEHISTORY ON SDSADM.STD_DATACHANGESOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DataChangeSourceHstry
after DELETE
ON SDSADM.STD_DATACHANGESOURCEHISTORY
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DataChangeSourceHstry
after INSERT
ON SDSADM.STD_DATACHANGESOURCEHISTORY
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DataChangeSourceHstry
after UPDATE
ON SDSADM.STD_DATACHANGESOURCEHISTORY
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataChangeSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DATACHANGESOURCEHISTORY FOR SDSADM.STD_DATACHANGESOURCEHISTORY;


ALTER TABLE SDSADM.STD_DATACHANGESOURCEHISTORY ADD (
  CONSTRAINT PK_STD_DATACHANGESOURCEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DATACHANGESOURCEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_DATACHANGESOURCEHISTORY ADD (
  CONSTRAINT FKSTD_DATACHANGESRCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_DATACHANGESOURCE (ID)
  ON DELETE CASCADE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DATACHANGESOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DATACHANGESOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DATACHANGESOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DATACHANGESOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DATACHANGESOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DATACHANGESOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DATACHANGESOURCE ON SDSADM.STD_DATACHANGESOURCE
(ID)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DATACHANGESOURCECODE ON SDSADM.STD_DATACHANGESOURCE
(CODE)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DATACHANGESOURCENAME ON SDSADM.STD_DATACHANGESOURCE
(NAME)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DataChangeSource
after DELETE
ON SDSADM.STD_DATACHANGESOURCE
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DataChangeSource
after INSERT
ON SDSADM.STD_DATACHANGESOURCE
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DataChangeSource
after UPDATE
ON SDSADM.STD_DATACHANGESOURCE
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DataChangeSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DATACHANGESOURCE FOR SDSADM.STD_DATACHANGESOURCE;


ALTER TABLE SDSADM.STD_DATACHANGESOURCE ADD (
  CONSTRAINT PK_STD_DATACHANGESOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DATACHANGESOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DATACHANGESOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_DATACHANGESOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DATACHANGESOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_DATACHANGESOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DATACHANGESOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DATACHANGESOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DATACHANGESOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DATACHANGESOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_DATABASEVERSION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_DATABASEVERSION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_DATABASEVERSION
(
  ID                NUMBER(20)                  NOT NULL,
  VERSIONNUMBER     VARCHAR2(16 BYTE)           NOT NULL,
  INSTALLATIONDATE  TIMESTAMP(6)                NOT NULL,
  DESCRIPTION       VARCHAR2(100 BYTE),
  VERSION           INTEGER                     NOT NULL,
  CREATED           TIMESTAMP(6)                NOT NULL,
  UPDATED           TIMESTAMP(6),
  CREATEDBY         VARCHAR2(32 BYTE)           NOT NULL,
  UPDATEDBY         VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_DATABASEVERSION ON SDSADM.STD_DATABASEVERSION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_DATABASEVERSIONVRSNNMBR ON SDSADM.STD_DATABASEVERSION
(VERSIONNUMBER)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_DatabaseVersion
after DELETE
ON SDSADM.STD_DATABASEVERSION
BEGIN
	-- update the table for STD_DatabaseVersion operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DatabaseVersion';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_DatabaseVersion
after INSERT
ON SDSADM.STD_DATABASEVERSION
BEGIN
	-- update the table for STD_DatabaseVersion operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DatabaseVersion';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_DatabaseVersion
after UPDATE
ON SDSADM.STD_DATABASEVERSION
BEGIN
	-- update the table for STD_DatabaseVersion operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_DatabaseVersion';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_DATABASEVERSION FOR SDSADM.STD_DATABASEVERSION;


ALTER TABLE SDSADM.STD_DATABASEVERSION ADD (
  CONSTRAINT PK_STD_DATABASEVERSION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_DATABASEVERSION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_DATABASEVERSIONVRSNNMBR
  UNIQUE (VERSIONNUMBER)
  USING INDEX SDSADM.UQSTD_DATABASEVERSIONVRSNNMBR
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_DATABASEVERSION TO ADR;

GRANT SELECT ON SDSADM.STD_DATABASEVERSION TO ADREXT;

GRANT SELECT ON SDSADM.STD_DATABASEVERSION TO EESRV;

GRANT SELECT ON SDSADM.STD_DATABASEVERSION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_DATABASEVERSION TO LOBR;

GRANT SELECT ON SDSADM.STD_DATABASEVERSION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_DATABASEVERSION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_DATABASEVERSION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_DATABASEVERSION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COUNTYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COUNTYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COUNTYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COUNTYHISTORY ON SDSADM.STD_COUNTYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CountyHistory
after DELETE
ON SDSADM.STD_COUNTYHISTORY
BEGIN
	-- update the table for STD_CountyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CountyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CountyHistory
after INSERT
ON SDSADM.STD_COUNTYHISTORY
BEGIN
	-- update the table for STD_CountyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CountyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CountyHistory
after UPDATE
ON SDSADM.STD_COUNTYHISTORY
BEGIN
	-- update the table for STD_CountyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CountyHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COUNTYHISTORY FOR SDSADM.STD_COUNTYHISTORY;


ALTER TABLE SDSADM.STD_COUNTYHISTORY ADD (
  CONSTRAINT PK_STD_COUNTYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COUNTYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_COUNTYHISTORY ADD (
  CONSTRAINT FKSTD_COUNTYHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_COUNTY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COUNTYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_COUNTYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_COUNTYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_COUNTYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COUNTYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_COUNTYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COUNTYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COUNTYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COUNTYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COUNTY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COUNTY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COUNTY
(
  ID            NUMBER(20)                      NOT NULL,
  NAME          VARCHAR2(35 BYTE)               NOT NULL,
  COUNTYNUMBER  CHAR(3 BYTE)                    NOT NULL,
  DESCRIPTION   VARCHAR2(60 BYTE),
  STATE_ID      NUMBER(20)                      NOT NULL,
  VERSION       INTEGER                         NOT NULL,
  CREATED       TIMESTAMP(6)                    NOT NULL,
  UPDATED       TIMESTAMP(6),
  CREATEDBY     VARCHAR2(32 BYTE)               NOT NULL,
  UPDATEDBY     VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COUNTY ON SDSADM.STD_COUNTY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_County
after DELETE
ON SDSADM.STD_COUNTY
BEGIN
	-- update the table for STD_County operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_County';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_County
after INSERT
ON SDSADM.STD_COUNTY
BEGIN
	-- update the table for STD_County operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_County';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_County
after UPDATE
ON SDSADM.STD_COUNTY
BEGIN
	-- update the table for STD_County operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_County';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COUNTY FOR SDSADM.STD_COUNTY;


ALTER TABLE SDSADM.STD_COUNTY ADD (
  CONSTRAINT PK_STD_COUNTY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COUNTY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_COUNTY ADD (
  CONSTRAINT FKSTD_COUNTYSTATE 
  FOREIGN KEY (STATE_ID) 
  REFERENCES SDSADM.STD_STATE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COUNTY TO ADR;

GRANT SELECT ON SDSADM.STD_COUNTY TO ADREXT;

GRANT SELECT ON SDSADM.STD_COUNTY TO EESRV;

GRANT SELECT ON SDSADM.STD_COUNTY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COUNTY TO LOBR;

GRANT SELECT ON SDSADM.STD_COUNTY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COUNTY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COUNTY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COUNTY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COUNTRYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COUNTRYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COUNTRYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COUNTRYHISTORY ON SDSADM.STD_COUNTRYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CountryHistory
after DELETE
ON SDSADM.STD_COUNTRYHISTORY
BEGIN
	-- update the table for STD_CountryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CountryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CountryHistory
after INSERT
ON SDSADM.STD_COUNTRYHISTORY
BEGIN
	-- update the table for STD_CountryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CountryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CountryHistory
after UPDATE
ON SDSADM.STD_COUNTRYHISTORY
BEGIN
	-- update the table for STD_CountryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CountryHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COUNTRYHISTORY FOR SDSADM.STD_COUNTRYHISTORY;


ALTER TABLE SDSADM.STD_COUNTRYHISTORY ADD (
  CONSTRAINT PK_STD_COUNTRYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COUNTRYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_COUNTRYHISTORY ADD (
  CONSTRAINT FKSTD_COUNTRYHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_COUNTRY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COUNTRYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_COUNTRYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_COUNTRYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_COUNTRYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COUNTRYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_COUNTRYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COUNTRYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COUNTRYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COUNTRYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COUNTRY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COUNTRY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COUNTRY
(
  ID           NUMBER(20)                       NOT NULL,
  NUMERICCODE  CHAR(3 BYTE)                     NOT NULL,
  SHORTNAME    VARCHAR2(64 BYTE)                NOT NULL,
  ALPHA3CODE   CHAR(3 BYTE)                     NOT NULL,
  FIPSCODE     CHAR(2 BYTE)                     NOT NULL,
  POSTALNAME   VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COUNTRY ON SDSADM.STD_COUNTRY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COUNTRYALPHA3CODE ON SDSADM.STD_COUNTRY
(ALPHA3CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COUNTRYFIPSCODE ON SDSADM.STD_COUNTRY
(FIPSCODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COUNTRYNUMERICCODE ON SDSADM.STD_COUNTRY
(NUMERICCODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Country
after DELETE
ON SDSADM.STD_COUNTRY
BEGIN
	-- update the table for STD_Country operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Country';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Country
after INSERT
ON SDSADM.STD_COUNTRY
BEGIN
	-- update the table for STD_Country operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Country';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Country
after UPDATE
ON SDSADM.STD_COUNTRY
BEGIN
	-- update the table for STD_Country operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Country';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COUNTRY FOR SDSADM.STD_COUNTRY;


ALTER TABLE SDSADM.STD_COUNTRY ADD (
  CONSTRAINT PK_STD_COUNTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COUNTRY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COUNTRYALPHA3CODE
  UNIQUE (ALPHA3CODE)
  USING INDEX SDSADM.UQSTD_COUNTRYALPHA3CODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COUNTRYFIPSCODE
  UNIQUE (FIPSCODE)
  USING INDEX SDSADM.UQSTD_COUNTRYFIPSCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COUNTRYNUMERICCODE
  UNIQUE (NUMERICCODE)
  USING INDEX SDSADM.UQSTD_COUNTRYNUMERICCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COUNTRY TO ADR;

GRANT SELECT ON SDSADM.STD_COUNTRY TO ADREXT;

GRANT SELECT ON SDSADM.STD_COUNTRY TO EESRV;

GRANT SELECT ON SDSADM.STD_COUNTRY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COUNTRY TO LOBR;

GRANT SELECT ON SDSADM.STD_COUNTRY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COUNTRY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COUNTRY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COUNTRY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CORRESPONDENCETYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CORRESPONDENCETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CORRESPONDENCETYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CORRESPONDENCETYPEHSTRY ON SDSADM.STD_CORRESPONDENCETYPEHISTORY
(ID)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CrrspndncTypHstry
after DELETE
ON SDSADM.STD_CORRESPONDENCETYPEHISTORY
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CorrespondenceTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CrrspndncTypHstry
after INSERT
ON SDSADM.STD_CORRESPONDENCETYPEHISTORY
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CorrespondenceTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CrrspndncTypHstry
after UPDATE
ON SDSADM.STD_CORRESPONDENCETYPEHISTORY
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CorrespondenceTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CORRESPONDENCETYPEHISTORY FOR SDSADM.STD_CORRESPONDENCETYPEHISTORY;


ALTER TABLE SDSADM.STD_CORRESPONDENCETYPEHISTORY ADD (
  CONSTRAINT PK_STD_CORRESPONDENCETYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CORRESPONDENCETYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_CORRESPONDENCETYPEHISTORY ADD (
  CONSTRAINT FKSTD_CRRSPNDNCTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_CORRESPONDENCETYPE (ID)
  ON DELETE CASCADE
  ENABLE VALIDATE);

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CORRESPONDENCETYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CORRESPONDENCETYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CORRESPONDENCETYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CORRESPONDENCETYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CORRESPONDENCETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CORRESPONDENCETYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CORRESPONDENCETYPE ON SDSADM.STD_CORRESPONDENCETYPE
(ID)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CORRESPONDENCETYPECODE ON SDSADM.STD_CORRESPONDENCETYPE
(CODE)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CORRESPONDENCETYPENAME ON SDSADM.STD_CORRESPONDENCETYPE
(NAME)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CorrespondenceType
after DELETE
ON SDSADM.STD_CORRESPONDENCETYPE
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CorrespondenceType';

END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CorrespondenceType
after INSERT
ON SDSADM.STD_CORRESPONDENCETYPE
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CorrespondenceType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CorrespondenceType
after UPDATE
ON SDSADM.STD_CORRESPONDENCETYPE
BEGIN
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CorrespondenceType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CORRESPONDENCETYPE FOR SDSADM.STD_CORRESPONDENCETYPE;


ALTER TABLE SDSADM.STD_CORRESPONDENCETYPE ADD (
  CONSTRAINT PK_STD_CORRESPONDENCETYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CORRESPONDENCETYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CORRESPONDENCETYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_CORRESPONDENCETYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CORRESPONDENCETYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_CORRESPONDENCETYPENAME
  ENABLE VALIDATE);

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CORRESPONDENCETYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CORRESPONDENCETYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CORRESPONDENCETYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CONFIDENTIALADDRESSCAT
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CONFIDENTIALADDRESSCAT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CONFIDENTIALADDRESSCAT
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  HL7VALUE     VARCHAR2(10 BYTE),
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CONFADDRCAT ON SDSADM.STD_CONFIDENTIALADDRESSCAT
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CONFADDRCATCODE ON SDSADM.STD_CONFIDENTIALADDRESSCAT
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CONFADDRCATHL7VALUE ON SDSADM.STD_CONFIDENTIALADDRESSCAT
(HL7VALUE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CONFADDRCATNAME ON SDSADM.STD_CONFIDENTIALADDRESSCAT
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ConfAddrCat
after DELETE
ON SDSADM.STD_CONFIDENTIALADDRESSCAT
BEGIN
	-- update the table for STD_ConfidentialAddressCat operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConfidentialAddressCat';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ConfAddrCat
after INSERT
ON SDSADM.STD_CONFIDENTIALADDRESSCAT
BEGIN
	-- update the table for STD_ConfidentialAddressCat operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConfidentialAddressCat';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ConfAddrCat
after UPDATE
ON SDSADM.STD_CONFIDENTIALADDRESSCAT
BEGIN
	-- update the table for STD_ConfidentialAddressCat operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConfidentialAddressCat';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CONFIDENTIALADDRESSCAT FOR SDSADM.STD_CONFIDENTIALADDRESSCAT;


ALTER TABLE SDSADM.STD_CONFIDENTIALADDRESSCAT ADD (
  CONSTRAINT PK_STD_CONFADDRCAT
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CONFADDRCAT
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CONFADDRCATCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_CONFADDRCATCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CONFADDRCATHL7VALUE
  UNIQUE (HL7VALUE)
  USING INDEX SDSADM.UQSTD_CONFADDRCATHL7VALUE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CONFADDRCATNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_CONFADDRCATNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CONFIDENTIALADDRESSCAT TO ADR;

GRANT SELECT ON SDSADM.STD_CONFIDENTIALADDRESSCAT TO ADREXT;

GRANT SELECT ON SDSADM.STD_CONFIDENTIALADDRESSCAT TO EESRV;

GRANT SELECT ON SDSADM.STD_CONFIDENTIALADDRESSCAT TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CONFIDENTIALADDRESSCAT TO LOBR;

GRANT SELECT ON SDSADM.STD_CONFIDENTIALADDRESSCAT TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CONFIDENTIALADDRESSCAT TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CONFIDENTIALADDRESSCAT TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CONFIDENTIALADDRESSCAT TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CONFADDRCATHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CONFADDRCATHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CONFADDRCATHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CONFADDRCATHISTORY ON SDSADM.STD_CONFADDRCATHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ConfAddrCatHistory
after DELETE
ON SDSADM.STD_CONFADDRCATHISTORY
BEGIN
	-- update the table for STD_ConfAddrCatHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConfAddrCatHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ConfAddrCatHistory
after INSERT
ON SDSADM.STD_CONFADDRCATHISTORY
BEGIN
	-- update the table for STD_ConfAddrCatHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConfAddrCatHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ConfAddrCatHistory
after UPDATE
ON SDSADM.STD_CONFADDRCATHISTORY
BEGIN
	-- update the table for STD_ConfAddrCatHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConfAddrCatHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CONFADDRCATHISTORY FOR SDSADM.STD_CONFADDRCATHISTORY;


ALTER TABLE SDSADM.STD_CONFADDRCATHISTORY ADD (
  CONSTRAINT PK_STD_CONFADDRCATHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CONFADDRCATHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_CONFADDRCATHISTORY ADD (
  CONSTRAINT FKSTD_CONFADDRCATHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_CONFIDENTIALADDRESSCAT (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CONFADDRCATHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_CONFADDRCATHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_CONFADDRCATHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_CONFADDRCATHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CONFADDRCATHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_CONFADDRCATHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CONFADDRCATHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CONFADDRCATHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CONFADDRCATHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CONDITIONCODEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CONDITIONCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CONDITIONCODEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CONDITIONCODEHISTORY ON SDSADM.STD_CONDITIONCODEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ConditionCodeHistory
after DELETE
ON SDSADM.STD_CONDITIONCODEHISTORY
BEGIN
	-- update the table for STD_ConditionCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConditionCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ConditionCodeHistory
after INSERT
ON SDSADM.STD_CONDITIONCODEHISTORY
BEGIN
	-- update the table for STD_ConditionCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConditionCodeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ConditionCodeHistory
after UPDATE
ON SDSADM.STD_CONDITIONCODEHISTORY
BEGIN
	-- update the table for STD_ConditionCodeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConditionCodeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CONDITIONCODEHISTORY FOR SDSADM.STD_CONDITIONCODEHISTORY;


ALTER TABLE SDSADM.STD_CONDITIONCODEHISTORY ADD (
  CONSTRAINT PK_STD_CONDITIONCODEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CONDITIONCODEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_CONDITIONCODEHISTORY ADD (
  CONSTRAINT FKSTD_CONDITIONCODEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_CONDITIONCODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CONDITIONCODEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_CONDITIONCODEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_CONDITIONCODEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_CONDITIONCODEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CONDITIONCODEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_CONDITIONCODEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CONDITIONCODEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CONDITIONCODEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CONDITIONCODEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CONDITIONCODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CONDITIONCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CONDITIONCODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CONDITIONCODE ON SDSADM.STD_CONDITIONCODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CONDITIONCODECODE ON SDSADM.STD_CONDITIONCODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CONDITIONCODENAME ON SDSADM.STD_CONDITIONCODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ConditionCode
after DELETE
ON SDSADM.STD_CONDITIONCODE
BEGIN
	-- update the table for STD_ConditionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConditionCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ConditionCode
after INSERT
ON SDSADM.STD_CONDITIONCODE
BEGIN
	-- update the table for STD_ConditionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConditionCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ConditionCode
after UPDATE
ON SDSADM.STD_CONDITIONCODE
BEGIN
	-- update the table for STD_ConditionCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ConditionCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CONDITIONCODE FOR SDSADM.STD_CONDITIONCODE;


ALTER TABLE SDSADM.STD_CONDITIONCODE ADD (
  CONSTRAINT PK_STD_CONDITIONCODE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CONDITIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CONDITIONCODECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_CONDITIONCODECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CONDITIONCODENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_CONDITIONCODENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CONDITIONCODE TO ADR;

GRANT SELECT ON SDSADM.STD_CONDITIONCODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_CONDITIONCODE TO EESRV;

GRANT SELECT ON SDSADM.STD_CONDITIONCODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CONDITIONCODE TO LOBR;

GRANT SELECT ON SDSADM.STD_CONDITIONCODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CONDITIONCODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CONDITIONCODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CONDITIONCODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COMBATSVCSOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COMBATSVCSOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COMBATSVCSOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COMBATSVCSOURCEHISTORY ON SDSADM.STD_COMBATSVCSOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CombatSvcSourceHstry
after DELETE
ON SDSADM.STD_COMBATSVCSOURCEHISTORY
BEGIN
	-- update the table for STD_CombatSvcSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CombatSvcSourceHstry
after INSERT
ON SDSADM.STD_COMBATSVCSOURCEHISTORY
BEGIN
	-- update the table for STD_CombatSvcSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CombatSvcSourceHstry
after UPDATE
ON SDSADM.STD_COMBATSVCSOURCEHISTORY
BEGIN
	-- update the table for STD_CombatSvcSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COMBATSVCSOURCEHISTORY FOR SDSADM.STD_COMBATSVCSOURCEHISTORY;


ALTER TABLE SDSADM.STD_COMBATSVCSOURCEHISTORY ADD (
  CONSTRAINT PK_STD_COMBATSVCSOURCEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COMBATSVCSOURCEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_COMBATSVCSOURCEHISTORY ADD (
  CONSTRAINT FKSTD_COMBATSVCSOURCEHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_COMBATSVCSOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COMBATSVCSOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COMBATSVCSOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COMBATSVCSOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COMBATSVCSOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COMBATSVCSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COMBATSVCSOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COMBATSVCSOURCE ON SDSADM.STD_COMBATSVCSOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COMBATSVCSOURCECODE ON SDSADM.STD_COMBATSVCSOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COMBATSVCSOURCENAME ON SDSADM.STD_COMBATSVCSOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CombatSvcSource
after DELETE
ON SDSADM.STD_COMBATSVCSOURCE
BEGIN
	-- update the table for STD_CombatSvcSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CombatSvcSource
after INSERT
ON SDSADM.STD_COMBATSVCSOURCE
BEGIN
	-- update the table for STD_CombatSvcSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CombatSvcSource
after UPDATE
ON SDSADM.STD_COMBATSVCSOURCE
BEGIN
	-- update the table for STD_CombatSvcSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COMBATSVCSOURCE FOR SDSADM.STD_COMBATSVCSOURCE;


ALTER TABLE SDSADM.STD_COMBATSVCSOURCE ADD (
  CONSTRAINT PK_STD_COMBATSVCSOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COMBATSVCSOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COMBATSVCSOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_COMBATSVCSOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COMBATSVCSOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_COMBATSVCSOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COMBATSVCSOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COMBATSVCSOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COMBATSVCSOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COMBATSVCSOURCE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COMBATSVCLOCATIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COMBATSVCLOCATIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COMBATSVCLOCATIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COMBATSVCLOCATIONHSTRY ON SDSADM.STD_COMBATSVCLOCATIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CombatSvcLctnHstry
after DELETE
ON SDSADM.STD_COMBATSVCLOCATIONHISTORY
BEGIN
	-- update the table for STD_CombatSvcLocationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcLocationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CombatSvcLctnHstry
after INSERT
ON SDSADM.STD_COMBATSVCLOCATIONHISTORY
BEGIN
	-- update the table for STD_CombatSvcLocationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcLocationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CombatSvcLctnHstry
after UPDATE
ON SDSADM.STD_COMBATSVCLOCATIONHISTORY
BEGIN
	-- update the table for STD_CombatSvcLocationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcLocationHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COMBATSVCLOCATIONHISTORY FOR SDSADM.STD_COMBATSVCLOCATIONHISTORY;


ALTER TABLE SDSADM.STD_COMBATSVCLOCATIONHISTORY ADD (
  CONSTRAINT PK_STD_COMBATSVCLOCATIONHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COMBATSVCLOCATIONHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_COMBATSVCLOCATIONHISTORY ADD (
  CONSTRAINT FKSTD_COMBATSVCLCTNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_COMBATSVCLOCATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COMBATSVCLOCATIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COMBATSVCLOCATIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COMBATSVCLOCATIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COMBATSVCLOCATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COMBATSVCLOCATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COMBATSVCLOCATION
(
  ID                  NUMBER(20)                NOT NULL,
  CODE                VARCHAR2(2 BYTE)          NOT NULL,
  AREA                VARCHAR2(120 BYTE)        NOT NULL,
  INCLUDED_LOCATIONS  VARCHAR2(120 BYTE)        NOT NULL,
  STARTDATE           DATE                      NOT NULL,
  ENDDATE             DATE,
  VERSION             INTEGER                   NOT NULL,
  CREATED             TIMESTAMP(6)              NOT NULL,
  UPDATED             TIMESTAMP(6),
  CREATEDBY           VARCHAR2(32 BYTE)         NOT NULL,
  UPDATEDBY           VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COMBATSVCLOCATION ON SDSADM.STD_COMBATSVCLOCATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COMBATSVCLOCATIONCODE ON SDSADM.STD_COMBATSVCLOCATION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CombatSvcLocation
after DELETE
ON SDSADM.STD_COMBATSVCLOCATION
BEGIN
	-- update the table for STD_CombatSvcLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcLocation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CombatSvcLocation
after INSERT
ON SDSADM.STD_COMBATSVCLOCATION
BEGIN
	-- update the table for STD_CombatSvcLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcLocation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CombatSvcLocation
after UPDATE
ON SDSADM.STD_COMBATSVCLOCATION
BEGIN
	-- update the table for STD_CombatSvcLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatSvcLocation';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COMBATSVCLOCATION FOR SDSADM.STD_COMBATSVCLOCATION;


ALTER TABLE SDSADM.STD_COMBATSVCLOCATION ADD (
  CONSTRAINT PK_STD_COMBATSVCLOCATION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COMBATSVCLOCATION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COMBATSVCLOCATIONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_COMBATSVCLOCATIONCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COMBATSVCLOCATION TO ADR;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATION TO EESRV;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COMBATSVCLOCATION TO LOBR;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COMBATSVCLOCATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COMBATSVCLOCATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COMBATPAYTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COMBATPAYTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COMBATPAYTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COMBATPAYTYPEHISTORY ON SDSADM.STD_COMBATPAYTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CombatPayTypeHistory
after DELETE
ON SDSADM.STD_COMBATPAYTYPEHISTORY
BEGIN
	-- update the table for STD_CombatPayTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatPayTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CombatPayTypeHistory
after INSERT
ON SDSADM.STD_COMBATPAYTYPEHISTORY
BEGIN
	-- update the table for STD_CombatPayTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatPayTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CombatPayTypeHistory
after UPDATE
ON SDSADM.STD_COMBATPAYTYPEHISTORY
BEGIN
	-- update the table for STD_CombatPayTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatPayTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COMBATPAYTYPEHISTORY FOR SDSADM.STD_COMBATPAYTYPEHISTORY;


ALTER TABLE SDSADM.STD_COMBATPAYTYPEHISTORY ADD (
  CONSTRAINT PK_STD_COMBATPAYTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COMBATPAYTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_COMBATPAYTYPEHISTORY ADD (
  CONSTRAINT FKSTD_COMBATPAYTYPEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_COMBATPAYTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COMBATPAYTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COMBATPAYTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COMBATPAYTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COMBATPAYTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COMBATPAYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COMBATPAYTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COMBATPAYTYPE ON SDSADM.STD_COMBATPAYTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COMBATPAYTYPECODE ON SDSADM.STD_COMBATPAYTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COMBATPAYTYPENAME ON SDSADM.STD_COMBATPAYTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CombatPayType
after DELETE
ON SDSADM.STD_COMBATPAYTYPE
BEGIN
	-- update the table for STD_CombatPayType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatPayType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CombatPayType
after INSERT
ON SDSADM.STD_COMBATPAYTYPE
BEGIN
	-- update the table for STD_CombatPayType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatPayType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CombatPayType
after UPDATE
ON SDSADM.STD_COMBATPAYTYPE
BEGIN
	-- update the table for STD_CombatPayType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatPayType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COMBATPAYTYPE FOR SDSADM.STD_COMBATPAYTYPE;


ALTER TABLE SDSADM.STD_COMBATPAYTYPE ADD (
  CONSTRAINT PK_STD_COMBATPAYTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COMBATPAYTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COMBATPAYTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_COMBATPAYTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COMBATPAYTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_COMBATPAYTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COMBATPAYTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COMBATPAYTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COMBATPAYTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COMBATPAYTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COMBATLOCATIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COMBATLOCATIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COMBATLOCATIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COMBATLOCATIONHISTORY ON SDSADM.STD_COMBATLOCATIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CombatLocationHistory
after DELETE
ON SDSADM.STD_COMBATLOCATIONHISTORY
BEGIN
	-- update the table for STD_CombatLocationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatLocationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CombatLocationHistory
after INSERT
ON SDSADM.STD_COMBATLOCATIONHISTORY
BEGIN
	-- update the table for STD_CombatLocationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatLocationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CombatLocationHistory
after UPDATE
ON SDSADM.STD_COMBATLOCATIONHISTORY
BEGIN
	-- update the table for STD_CombatLocationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatLocationHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COMBATLOCATIONHISTORY FOR SDSADM.STD_COMBATLOCATIONHISTORY;


ALTER TABLE SDSADM.STD_COMBATLOCATIONHISTORY ADD (
  CONSTRAINT PK_STD_COMBATLOCATIONHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COMBATLOCATIONHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_COMBATLOCATIONHISTORY ADD (
  CONSTRAINT FKSTD_COMBATLOCATIONHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_COMBATLOCATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COMBATLOCATIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_COMBATLOCATIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_COMBATLOCATIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_COMBATLOCATIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COMBATLOCATIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_COMBATLOCATIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COMBATLOCATIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COMBATLOCATIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COMBATLOCATIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COMBATLOCATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COMBATLOCATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COMBATLOCATION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(2 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  OEIF_IND     NUMBER(10),
  STARTDATE    DATE                             NOT NULL,
  ENDDATE      DATE,
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COMBATLOCATION ON SDSADM.STD_COMBATLOCATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COMBATLOCATIONCODE ON SDSADM.STD_COMBATLOCATION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COMBATLOCATIONNAME ON SDSADM.STD_COMBATLOCATION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CombatLocation
after DELETE
ON SDSADM.STD_COMBATLOCATION
BEGIN
	-- update the table for STD_CombatLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatLocation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CombatLocation
after INSERT
ON SDSADM.STD_COMBATLOCATION
BEGIN
	-- update the table for STD_CombatLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatLocation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CombatLocation
after UPDATE
ON SDSADM.STD_COMBATLOCATION
BEGIN
	-- update the table for STD_CombatLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CombatLocation';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COMBATLOCATION FOR SDSADM.STD_COMBATLOCATION;


ALTER TABLE SDSADM.STD_COMBATLOCATION ADD (
  CONSTRAINT PK_STD_COMBATLOCATION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COMBATLOCATION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COMBATLOCATIONCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_COMBATLOCATIONCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COMBATLOCATIONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_COMBATLOCATIONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COMBATLOCATION TO ADR;

GRANT SELECT ON SDSADM.STD_COMBATLOCATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_COMBATLOCATION TO EESRV;

GRANT SELECT ON SDSADM.STD_COMBATLOCATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COMBATLOCATION TO LOBR;

GRANT SELECT ON SDSADM.STD_COMBATLOCATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COMBATLOCATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COMBATLOCATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COMBATLOCATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COLLECTIONMETHOD
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COLLECTIONMETHOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COLLECTIONMETHOD
(
  ID           NUMBER(20)                       NOT NULL,
  HL7CODE      VARCHAR2(8 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COLLECTION ON SDSADM.STD_COLLECTIONMETHOD
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COLLECTIONHL7CODE ON SDSADM.STD_COLLECTIONMETHOD
(HL7CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_COLLECTIONNAME ON SDSADM.STD_COLLECTIONMETHOD
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Collection
after DELETE
ON SDSADM.STD_COLLECTIONMETHOD
BEGIN
	-- update the table for STD_CollectionMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CollectionMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Collection
after INSERT
ON SDSADM.STD_COLLECTIONMETHOD
BEGIN
	-- update the table for STD_CollectionMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CollectionMethod';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Collection
after UPDATE
ON SDSADM.STD_COLLECTIONMETHOD
BEGIN
	-- update the table for STD_CollectionMethod operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CollectionMethod';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COLLECTIONMETHOD FOR SDSADM.STD_COLLECTIONMETHOD;


ALTER TABLE SDSADM.STD_COLLECTIONMETHOD ADD (
  CONSTRAINT PK_STD_COLLECTION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COLLECTION
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COLLECTIONHL7CODE
  UNIQUE (HL7CODE)
  USING INDEX SDSADM.UQSTD_COLLECTIONHL7CODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_COLLECTIONNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_COLLECTIONNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COLLECTIONMETHOD TO ADR;

GRANT SELECT ON SDSADM.STD_COLLECTIONMETHOD TO ADREXT;

GRANT SELECT ON SDSADM.STD_COLLECTIONMETHOD TO EESRV;

GRANT SELECT ON SDSADM.STD_COLLECTIONMETHOD TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COLLECTIONMETHOD TO LOBR;

GRANT SELECT ON SDSADM.STD_COLLECTIONMETHOD TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COLLECTIONMETHOD TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COLLECTIONMETHOD TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COLLECTIONMETHOD TO SDS_SELECT;
ALTER TABLE SDSADM.STD_COLLECTIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_COLLECTIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_COLLECTIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_COLLECTIONHISTORY ON SDSADM.STD_COLLECTIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CollectionHistory
after DELETE
ON SDSADM.STD_COLLECTIONHISTORY
BEGIN
	-- update the table for STD_CollectionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CollectionHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CollectionHistory
after INSERT
ON SDSADM.STD_COLLECTIONHISTORY
BEGIN
	-- update the table for STD_CollectionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CollectionHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CollectionHistory
after UPDATE
ON SDSADM.STD_COLLECTIONHISTORY
BEGIN
	-- update the table for STD_CollectionHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CollectionHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_COLLECTIONHISTORY FOR SDSADM.STD_COLLECTIONHISTORY;


ALTER TABLE SDSADM.STD_COLLECTIONHISTORY ADD (
  CONSTRAINT PK_STD_COLLECTIONHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_COLLECTIONHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_COLLECTIONHISTORY ADD (
  CONSTRAINT FKSTD_COLLECTIONHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_COLLECTIONMETHOD (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_COLLECTIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_COLLECTIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_COLLECTIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_COLLECTIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_COLLECTIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_COLLECTIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_COLLECTIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_COLLECTIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_COLLECTIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CODINGSYSTEMHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CODINGSYSTEMHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CODINGSYSTEMHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CODINGSYSTEMHISTORY ON SDSADM.STD_CODINGSYSTEMHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CodingSystemHistory
after DELETE
ON SDSADM.STD_CODINGSYSTEMHISTORY
BEGIN
	-- update the table for STD_CodingSystemHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CodingSystemHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CodingSystemHistory
after INSERT
ON SDSADM.STD_CODINGSYSTEMHISTORY
BEGIN
	-- update the table for STD_CodingSystemHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CodingSystemHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CodingSystemHistory
after UPDATE
ON SDSADM.STD_CODINGSYSTEMHISTORY
BEGIN
	-- update the table for STD_CodingSystemHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CodingSystemHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CODINGSYSTEMHISTORY FOR SDSADM.STD_CODINGSYSTEMHISTORY;


ALTER TABLE SDSADM.STD_CODINGSYSTEMHISTORY ADD (
  CONSTRAINT PK_STD_CODINGSYSTEMHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CODINGSYSTEMHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_CODINGSYSTEMHISTORY ADD (
  CONSTRAINT FKSTD_CODINGSYSTEMHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_CODINGSYSTEM (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CODINGSYSTEMHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEMHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEMHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEMHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CODINGSYSTEMHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEMHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CODINGSYSTEMHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEMHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEMHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CODINGSYSTEM
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CODINGSYSTEM CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CODINGSYSTEM
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(20 BYTE)                NOT NULL,
  NAME         VARCHAR2(45 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CODINGSYSTEM ON SDSADM.STD_CODINGSYSTEM
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CODINGSYSTEMCODE ON SDSADM.STD_CODINGSYSTEM
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CODINGSYSTEMNAME ON SDSADM.STD_CODINGSYSTEM
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CodingSystem
after DELETE
ON SDSADM.STD_CODINGSYSTEM
BEGIN
	-- update the table for STD_CodingSystem operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CodingSystem';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CodingSystem
after INSERT
ON SDSADM.STD_CODINGSYSTEM
BEGIN
	-- update the table for STD_CodingSystem operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CodingSystem';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CodingSystem
after UPDATE
ON SDSADM.STD_CODINGSYSTEM
BEGIN
	-- update the table for STD_CodingSystem operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CodingSystem';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CODINGSYSTEM FOR SDSADM.STD_CODINGSYSTEM;


ALTER TABLE SDSADM.STD_CODINGSYSTEM ADD (
  CONSTRAINT PK_STD_CODINGSYSTEM
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CODINGSYSTEM
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CODINGSYSTEMCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_CODINGSYSTEMCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CODINGSYSTEMNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_CODINGSYSTEMNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CODINGSYSTEM TO ADR;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEM TO ADREXT;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEM TO EESRV;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEM TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CODINGSYSTEM TO LOBR;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEM TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CODINGSYSTEM TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEM TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CODINGSYSTEM TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CODESET
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CODESET CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CODESET
(
  ID                       NUMBER(20)           NOT NULL,
  CODE                     VARCHAR2(30 BYTE),
  NAME                     VARCHAR2(70 BYTE)    NOT NULL,
  DESCRIPTION              VARCHAR2(2000 BYTE),
  IMPLEMENTOR              VARCHAR2(10 BYTE)    NOT NULL,
  CLASSNAME                VARCHAR2(100 BYTE)   NOT NULL,
  TABLENAME                VARCHAR2(30 BYTE)    NOT NULL,
  DATACONTENTSTEWARD       VARCHAR2(60 BYTE),
  POCEMAILADDRESS          VARCHAR2(200 BYTE),
  APPLICATIONSERVICEOWNER  VARCHAR2(60 BYTE),
  REGISTEREDUSERS          VARCHAR2(2000 BYTE),
  INTEGRATIONAGREEMENTS    CHAR(1 BYTE),
  VERSION                  INTEGER              NOT NULL,
  CREATED                  TIMESTAMP(6)         NOT NULL,
  UPDATED                  TIMESTAMP(6),
  CREATEDBY                VARCHAR2(32 BYTE)    NOT NULL,
  UPDATEDBY                VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CODESET ON SDSADM.STD_CODESET
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CODESETCLASSNAME ON SDSADM.STD_CODESET
(CLASSNAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CODESETNAME ON SDSADM.STD_CODESET
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CODESETTABLENAME ON SDSADM.STD_CODESET
(TABLENAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CodeSet
after DELETE
ON SDSADM.STD_CODESET
BEGIN
	-- update the table for STD_CodeSet operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CodeSet';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CodeSet
after INSERT
ON SDSADM.STD_CODESET
BEGIN
	-- update the table for STD_CodeSet operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CodeSet';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CodeSet
after UPDATE
ON SDSADM.STD_CODESET
BEGIN
	-- update the table for STD_CodeSet operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CodeSet';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CODESET FOR SDSADM.STD_CODESET;


ALTER TABLE SDSADM.STD_CODESET ADD (
  CONSTRAINT PK_STD_CODESET
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CODESET
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CODESETCLASSNAME
  UNIQUE (CLASSNAME)
  USING INDEX SDSADM.UQSTD_CODESETCLASSNAME
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CODESETNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_CODESETNAME
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CODESETTABLENAME
  UNIQUE (TABLENAME)
  USING INDEX SDSADM.UQSTD_CODESETTABLENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CODESET TO ADR;

GRANT SELECT ON SDSADM.STD_CODESET TO ADREXT;

GRANT SELECT ON SDSADM.STD_CODESET TO EESRV;

GRANT SELECT ON SDSADM.STD_CODESET TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CODESET TO LOBR;

GRANT SELECT ON SDSADM.STD_CODESET TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CODESET TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CODESET TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CODESET TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CLINDETERTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CLINDETERTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CLINDETERTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CLINDETERTYPEHISTORY ON SDSADM.STD_CLINDETERTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ClinDeterTypeHistory
after DELETE
ON SDSADM.STD_CLINDETERTYPEHISTORY
BEGIN
	-- update the table for STD_ClinDeterTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ClinDeterTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ClinDeterTypeHistory
after INSERT
ON SDSADM.STD_CLINDETERTYPEHISTORY
BEGIN
	-- update the table for STD_ClinDeterTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ClinDeterTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ClinDeterTypeHistory
after UPDATE
ON SDSADM.STD_CLINDETERTYPEHISTORY
BEGIN
	-- update the table for STD_ClinDeterTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ClinDeterTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CLINDETERTYPEHISTORY FOR SDSADM.STD_CLINDETERTYPEHISTORY;


ALTER TABLE SDSADM.STD_CLINDETERTYPEHISTORY ADD (
  CONSTRAINT PK_STD_CLINDETERTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CLINDETERTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_CLINDETERTYPEHISTORY ADD (
  CONSTRAINT FKSTD_CLINDETERTYPEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_CLINDETERTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CLINDETERTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CLINDETERTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CLINDETERTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CLINDETERTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CLINDETERTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CLINDETERTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CLINDETERTYPE ON SDSADM.STD_CLINDETERTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CLINDETERTYPECODE ON SDSADM.STD_CLINDETERTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CLINDETERTYPENAME ON SDSADM.STD_CLINDETERTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ClinDeterType
after DELETE
ON SDSADM.STD_CLINDETERTYPE
BEGIN
	-- update the table for STD_ClinDeterType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ClinDeterType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ClinDeterType
after INSERT
ON SDSADM.STD_CLINDETERTYPE
BEGIN
	-- update the table for STD_ClinDeterType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ClinDeterType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ClinDeterType
after UPDATE
ON SDSADM.STD_CLINDETERTYPE
BEGIN
	-- update the table for STD_ClinDeterType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ClinDeterType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CLINDETERTYPE FOR SDSADM.STD_CLINDETERTYPE;


ALTER TABLE SDSADM.STD_CLINDETERTYPE ADD (
  CONSTRAINT PK_STD_CLINDETERTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CLINDETERTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CLINDETERTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_CLINDETERTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CLINDETERTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_CLINDETERTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CLINDETERTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CLINDETERTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CLINDETERTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CLINDETERTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CATADISABILITYEXTCDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CATADISABILITYEXTCDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CATADISABILITYEXTCDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CATADSBLTYEXTCDHSTRY ON SDSADM.STD_CATADISABILITYEXTCDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CataDsbltyExtCdHstry
after DELETE
ON SDSADM.STD_CATADISABILITYEXTCDHISTORY
BEGIN
	-- update the table for STD_CataDisabilityExtCdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CataDisabilityExtCdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CataDsbltyExtCdHstry
after INSERT
ON SDSADM.STD_CATADISABILITYEXTCDHISTORY
BEGIN
	-- update the table for STD_CataDisabilityExtCdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CataDisabilityExtCdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CataDsbltyExtCdHstry
after UPDATE
ON SDSADM.STD_CATADISABILITYEXTCDHISTORY
BEGIN
	-- update the table for STD_CataDisabilityExtCdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CataDisabilityExtCdHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CATADISABILITYEXTCDHISTORY FOR SDSADM.STD_CATADISABILITYEXTCDHISTORY;


ALTER TABLE SDSADM.STD_CATADISABILITYEXTCDHISTORY ADD (
  CONSTRAINT PK_STD_CATADSBLTYEXTCDHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CATADSBLTYEXTCDHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_CATADISABILITYEXTCDHISTORY ADD (
  CONSTRAINT FKSTD_CATADSBLTYEXTCDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_CATADISABILITYEXTCD (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CATADISABILITYEXTCDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CATADISABILITYEXTCDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CATADISABILITYEXTCDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CATADISABILITYEXTCD
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CATADISABILITYEXTCD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CATADISABILITYEXTCD
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CATADISABILITYEXTCD ON SDSADM.STD_CATADISABILITYEXTCD
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CATADISABILITYEXTCDCODE ON SDSADM.STD_CATADISABILITYEXTCD
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CATADISABILITYEXTCDNAME ON SDSADM.STD_CATADISABILITYEXTCD
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CataDisabilityExtCd
after DELETE
ON SDSADM.STD_CATADISABILITYEXTCD
BEGIN
	-- update the table for STD_CataDisabilityExtCd operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CataDisabilityExtCd';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CataDisabilityExtCd
after INSERT
ON SDSADM.STD_CATADISABILITYEXTCD
BEGIN
	-- update the table for STD_CataDisabilityExtCd operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CataDisabilityExtCd';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CataDisabilityExtCd
after UPDATE
ON SDSADM.STD_CATADISABILITYEXTCD
BEGIN
	-- update the table for STD_CataDisabilityExtCd operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CataDisabilityExtCd';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CATADISABILITYEXTCD FOR SDSADM.STD_CATADISABILITYEXTCD;


ALTER TABLE SDSADM.STD_CATADISABILITYEXTCD ADD (
  CONSTRAINT PK_STD_CATADISABILITYEXTCD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CATADISABILITYEXTCD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CATADISABILITYEXTCDCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_CATADISABILITYEXTCDCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CATADISABILITYEXTCDNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_CATADISABILITYEXTCDNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CATADISABILITYEXTCD TO ADR;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCD TO ADREXT;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCD TO EESRV;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCD TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CATADISABILITYEXTCD TO LOBR;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCD TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CATADISABILITYEXTCD TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCD TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CATADISABILITYEXTCD TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CANCELDECLINESTTYPHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CANCELDECLINESTTYPHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CANCELDECLINESTTYPHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CANCELDECLINESTTYPHSTRY ON SDSADM.STD_CANCELDECLINESTTYPHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CancelDclnStTypHstry
after DELETE
ON SDSADM.STD_CANCELDECLINESTTYPHISTORY
BEGIN
	-- update the table for STD_CancelDeclineStTypHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineStTypHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CancelDclnStTypHstry
after INSERT
ON SDSADM.STD_CANCELDECLINESTTYPHISTORY
BEGIN
	-- update the table for STD_CancelDeclineStTypHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineStTypHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CancelDclnStTypHstry
after UPDATE
ON SDSADM.STD_CANCELDECLINESTTYPHISTORY
BEGIN
	-- update the table for STD_CancelDeclineStTypHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineStTypHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CANCELDECLINESTTYPHISTORY FOR SDSADM.STD_CANCELDECLINESTTYPHISTORY;


ALTER TABLE SDSADM.STD_CANCELDECLINESTTYPHISTORY ADD (
  CONSTRAINT PK_STD_CANCELDECLINESTTYPHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CANCELDECLINESTTYPHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_CANCELDECLINESTTYPHISTORY ADD (
  CONSTRAINT FKSTD_CANCELDCLNSTTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_CANCELDECLINESTTYP (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CANCELDECLINESTTYPHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYPHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYPHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYPHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CANCELDECLINESTTYPHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYPHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CANCELDECLINESTTYPHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYPHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYPHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CANCELDECLINESTTYP
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CANCELDECLINESTTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CANCELDECLINESTTYP
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CANCELDECLINESTTYP ON SDSADM.STD_CANCELDECLINESTTYP
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CANCELDECLINESTTYPCODE ON SDSADM.STD_CANCELDECLINESTTYP
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CancelDeclineStTyp
after DELETE
ON SDSADM.STD_CANCELDECLINESTTYP
BEGIN
	-- update the table for STD_CancelDeclineStTyp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineStTyp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CancelDeclineStTyp
after INSERT
ON SDSADM.STD_CANCELDECLINESTTYP
BEGIN
	-- update the table for STD_CancelDeclineStTyp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineStTyp';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CancelDeclineStTyp
after UPDATE
ON SDSADM.STD_CANCELDECLINESTTYP
BEGIN
	-- update the table for STD_CancelDeclineStTyp operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineStTyp';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CANCELDECLINESTTYP FOR SDSADM.STD_CANCELDECLINESTTYP;


ALTER TABLE SDSADM.STD_CANCELDECLINESTTYP ADD (
  CONSTRAINT PK_STD_CANCELDECLINESTTYP
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CANCELDECLINESTTYP
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CANCELDECLINESTTYPCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_CANCELDECLINESTTYPCODE
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CANCELDECLINESTTYP TO ADR;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYP TO ADREXT;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYP TO EESRV;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYP TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CANCELDECLINESTTYP TO LOBR;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYP TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CANCELDECLINESTTYP TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYP TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CANCELDECLINESTTYP TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CANCELDECLINEREASON
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CANCELDECLINEREASON CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CANCELDECLINEREASON
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CANCELDECLINE ON SDSADM.STD_CANCELDECLINEREASON
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CANCELDECLINECODE ON SDSADM.STD_CANCELDECLINEREASON
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_CANCELDECLINENAME ON SDSADM.STD_CANCELDECLINEREASON
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CancelDecline
after DELETE
ON SDSADM.STD_CANCELDECLINEREASON
BEGIN
	-- update the table for STD_CancelDeclineReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CancelDecline
after INSERT
ON SDSADM.STD_CANCELDECLINEREASON
BEGIN
	-- update the table for STD_CancelDeclineReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CancelDecline
after UPDATE
ON SDSADM.STD_CANCELDECLINEREASON
BEGIN
	-- update the table for STD_CancelDeclineReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineReason';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CANCELDECLINEREASON FOR SDSADM.STD_CANCELDECLINEREASON;


ALTER TABLE SDSADM.STD_CANCELDECLINEREASON ADD (
  CONSTRAINT PK_STD_CANCELDECLINE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CANCELDECLINE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CANCELDECLINECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_CANCELDECLINECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_CANCELDECLINENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_CANCELDECLINENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CANCELDECLINEREASON TO ADR;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEREASON TO ADREXT;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEREASON TO EESRV;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEREASON TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CANCELDECLINEREASON TO LOBR;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEREASON TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CANCELDECLINEREASON TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEREASON TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEREASON TO SDS_SELECT;
ALTER TABLE SDSADM.STD_CANCELDECLINEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_CANCELDECLINEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_CANCELDECLINEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_CANCELDECLINEHISTORY ON SDSADM.STD_CANCELDECLINEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_CancelDeclineHistory
after DELETE
ON SDSADM.STD_CANCELDECLINEHISTORY
BEGIN
	-- update the table for STD_CancelDeclineHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_CancelDeclineHistory
after INSERT
ON SDSADM.STD_CANCELDECLINEHISTORY
BEGIN
	-- update the table for STD_CancelDeclineHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_CancelDeclineHistory
after UPDATE
ON SDSADM.STD_CANCELDECLINEHISTORY
BEGIN
	-- update the table for STD_CancelDeclineHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_CancelDeclineHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_CANCELDECLINEHISTORY FOR SDSADM.STD_CANCELDECLINEHISTORY;


ALTER TABLE SDSADM.STD_CANCELDECLINEHISTORY ADD (
  CONSTRAINT PK_STD_CANCELDECLINEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_CANCELDECLINEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_CANCELDECLINEHISTORY ADD (
  CONSTRAINT FKSTD_CANCELDECLINEHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_CANCELDECLINEREASON (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_CANCELDECLINEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_CANCELDECLINEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_CANCELDECLINEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_CANCELDECLINEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_BILLINGTRANSTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_BILLINGTRANSTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_BILLINGTRANSTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_BILLINGTRANSTYPEHISTORY ON SDSADM.STD_BILLINGTRANSTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_BillingTransTypeHstry
after DELETE
ON SDSADM.STD_BILLINGTRANSTYPEHISTORY
BEGIN
	-- update the table for STD_BillingTransTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BillingTransTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_BillingTransTypeHstry
after INSERT
ON SDSADM.STD_BILLINGTRANSTYPEHISTORY
BEGIN
	-- update the table for STD_BillingTransTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BillingTransTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_BillingTransTypeHstry
after UPDATE
ON SDSADM.STD_BILLINGTRANSTYPEHISTORY
BEGIN
	-- update the table for STD_BillingTransTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BillingTransTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_BILLINGTRANSTYPEHISTORY FOR SDSADM.STD_BILLINGTRANSTYPEHISTORY;


ALTER TABLE SDSADM.STD_BILLINGTRANSTYPEHISTORY ADD (
  CONSTRAINT PK_STD_BILLINGTRANSTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_BILLINGTRANSTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_BILLINGTRANSTYPEHISTORY ADD (
  CONSTRAINT FKSTD_BILLINGTRANSTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_BILLINGTRANSTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_BILLINGTRANSTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_BILLINGTRANSTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_BILLINGTRANSTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_BILLINGTRANSTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_BILLINGTRANSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_BILLINGTRANSTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_BILLINGTRANSTYPE ON SDSADM.STD_BILLINGTRANSTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_BILLINGTRANSTYPECODE ON SDSADM.STD_BILLINGTRANSTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_BILLINGTRANSTYPENAME ON SDSADM.STD_BILLINGTRANSTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_BillingTransType
after DELETE
ON SDSADM.STD_BILLINGTRANSTYPE
BEGIN
	-- update the table for STD_BillingTransType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BillingTransType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_BillingTransType
after INSERT
ON SDSADM.STD_BILLINGTRANSTYPE
BEGIN
	-- update the table for STD_BillingTransType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BillingTransType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_BillingTransType
after UPDATE
ON SDSADM.STD_BILLINGTRANSTYPE
BEGIN
	-- update the table for STD_BillingTransType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BillingTransType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_BILLINGTRANSTYPE FOR SDSADM.STD_BILLINGTRANSTYPE;


ALTER TABLE SDSADM.STD_BILLINGTRANSTYPE ADD (
  CONSTRAINT PK_STD_BILLINGTRANSTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_BILLINGTRANSTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_BILLINGTRANSTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_BILLINGTRANSTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_BILLINGTRANSTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_BILLINGTRANSTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_BILLINGTRANSTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_BILLINGTRANSTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_BILLINGTRANSTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_BILLINGTRANSTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_BENEFITSCOORDTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_BENEFITSCOORDTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_BENEFITSCOORDTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_BENEFITSCOORDTYPEHSTRY ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_BenefitsCoordTypHstry
after DELETE
ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY
BEGIN
	-- update the table for STD_BenefitsCoordTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BenefitsCoordTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_BenefitsCoordTypHstry
after INSERT
ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY
BEGIN
	-- update the table for STD_BenefitsCoordTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BenefitsCoordTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_BenefitsCoordTypHstry
after UPDATE
ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY
BEGIN
	-- update the table for STD_BenefitsCoordTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BenefitsCoordTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_BENEFITSCOORDTYPEHISTORY FOR SDSADM.STD_BENEFITSCOORDTYPEHISTORY;


ALTER TABLE SDSADM.STD_BENEFITSCOORDTYPEHISTORY ADD (
  CONSTRAINT PK_STD_BENEFITSCOORDTYPEHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_BENEFITSCOORDTYPEHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_BENEFITSCOORDTYPEHISTORY ADD (
  CONSTRAINT FKSTD_BENEFITSCRDTYPHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_BENEFITSCOORDTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_BENEFITSCOORDTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_BENEFITSCOORDTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_BENEFITSCOORDTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         CHAR(1 BYTE)                     NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_BENEFITSCOORDTYPE ON SDSADM.STD_BENEFITSCOORDTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_BENEFITSCOORDTYPECODE ON SDSADM.STD_BENEFITSCOORDTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_BENEFITSCOORDTYPENAME ON SDSADM.STD_BENEFITSCOORDTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_BenefitsCoordType
after DELETE
ON SDSADM.STD_BENEFITSCOORDTYPE
BEGIN
	-- update the table for STD_BenefitsCoordType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BenefitsCoordType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_BenefitsCoordType
after INSERT
ON SDSADM.STD_BENEFITSCOORDTYPE
BEGIN
	-- update the table for STD_BenefitsCoordType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BenefitsCoordType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_BenefitsCoordType
after UPDATE
ON SDSADM.STD_BENEFITSCOORDTYPE
BEGIN
	-- update the table for STD_BenefitsCoordType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_BenefitsCoordType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_BENEFITSCOORDTYPE FOR SDSADM.STD_BENEFITSCOORDTYPE;


ALTER TABLE SDSADM.STD_BENEFITSCOORDTYPE ADD (
  CONSTRAINT PK_STD_BENEFITSCOORDTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_BENEFITSCOORDTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_BENEFITSCOORDTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_BENEFITSCOORDTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_BENEFITSCOORDTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_BENEFITSCOORDTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_BENEFITSCOORDTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_BENEFITSCOORDTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_BENEFITSCOORDTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_BENEFITSCOORDTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ASSIGNINGAUTHORITYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ASSIGNINGAUTHORITYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ASSIGNINGAUTHORITYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ASSIGNINGAUTHORITYHSTRY ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AssigningAthrtyHstry
after DELETE
ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY
BEGIN
	-- update the table for STD_AssigningAuthorityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssigningAuthorityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AssigningAthrtyHstry
after INSERT
ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY
BEGIN
	-- update the table for STD_AssigningAuthorityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssigningAuthorityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AssigningAthrtyHstry
after UPDATE
ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY
BEGIN
	-- update the table for STD_AssigningAuthorityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssigningAuthorityHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ASSIGNINGAUTHORITYHISTORY FOR SDSADM.STD_ASSIGNINGAUTHORITYHISTORY;


ALTER TABLE SDSADM.STD_ASSIGNINGAUTHORITYHISTORY ADD (
  CONSTRAINT PK_STD_ASSIGNINGAUTHORITYHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ASSIGNINGAUTHORITYHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ASSIGNINGAUTHORITYHISTORY ADD (
  CONSTRAINT FKSTD_ASSIGNINGATHRTYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ASSIGNINGAUTHORITY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ASSIGNINGAUTHORITY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ASSIGNINGAUTHORITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ASSIGNINGAUTHORITY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(6 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  COUNTRY_ID   NUMBER(20),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ASSIGNINGAUTHORITY ON SDSADM.STD_ASSIGNINGAUTHORITY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ASSIGNINGAUTHORITYCODE ON SDSADM.STD_ASSIGNINGAUTHORITY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ASSIGNINGAUTHORITYNAME ON SDSADM.STD_ASSIGNINGAUTHORITY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AssigningAuthority
after DELETE
ON SDSADM.STD_ASSIGNINGAUTHORITY
BEGIN
	-- update the table for STD_AssigningAuthority operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssigningAuthority';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AssigningAuthority
after INSERT
ON SDSADM.STD_ASSIGNINGAUTHORITY
BEGIN
	-- update the table for STD_AssigningAuthority operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssigningAuthority';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AssigningAuthority
after UPDATE
ON SDSADM.STD_ASSIGNINGAUTHORITY
BEGIN
	-- update the table for STD_AssigningAuthority operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssigningAuthority';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ASSIGNINGAUTHORITY FOR SDSADM.STD_ASSIGNINGAUTHORITY;


ALTER TABLE SDSADM.STD_ASSIGNINGAUTHORITY ADD (
  CONSTRAINT PK_STD_ASSIGNINGAUTHORITY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ASSIGNINGAUTHORITY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ASSIGNINGAUTHORITYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ASSIGNINGAUTHORITYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ASSIGNINGAUTHORITYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ASSIGNINGAUTHORITYNAME
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ASSIGNINGAUTHORITY ADD (
  CONSTRAINT FKSTD_ASSIGNINGAUTHORITYCNTRY 
  FOREIGN KEY (COUNTRY_ID) 
  REFERENCES SDSADM.STD_COUNTRY (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ASSIGNINGAUTHORITY TO ADR;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITY TO EESRV;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ASSIGNINGAUTHORITY TO LOBR;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ASSIGNINGAUTHORITY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ASSIGNINGAUTHORITY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ASSETTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ASSETTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ASSETTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ASSETTYPEHISTORY ON SDSADM.STD_ASSETTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AssetTypeHistory
after DELETE
ON SDSADM.STD_ASSETTYPEHISTORY
BEGIN
	-- update the table for STD_AssetTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssetTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AssetTypeHistory
after INSERT
ON SDSADM.STD_ASSETTYPEHISTORY
BEGIN
	-- update the table for STD_AssetTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssetTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AssetTypeHistory
after UPDATE
ON SDSADM.STD_ASSETTYPEHISTORY
BEGIN
	-- update the table for STD_AssetTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssetTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ASSETTYPEHISTORY FOR SDSADM.STD_ASSETTYPEHISTORY;


ALTER TABLE SDSADM.STD_ASSETTYPEHISTORY ADD (
  CONSTRAINT PK_STD_ASSETTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ASSETTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ASSETTYPEHISTORY ADD (
  CONSTRAINT FKSTD_ASSETTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ASSETTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ASSETTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ASSETTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ASSETTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ASSETTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ASSETTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ASSETTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ASSETTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ASSETTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ASSETTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ASSETTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ASSETTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ASSETTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(80 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ASSETTYPE ON SDSADM.STD_ASSETTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ASSETTYPECODE ON SDSADM.STD_ASSETTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ASSETTYPENAME ON SDSADM.STD_ASSETTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AssetType
after DELETE
ON SDSADM.STD_ASSETTYPE
BEGIN
	-- update the table for STD_AssetType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssetType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AssetType
after INSERT
ON SDSADM.STD_ASSETTYPE
BEGIN
	-- update the table for STD_AssetType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssetType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AssetType
after UPDATE
ON SDSADM.STD_ASSETTYPE
BEGIN
	-- update the table for STD_AssetType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AssetType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ASSETTYPE FOR SDSADM.STD_ASSETTYPE;


ALTER TABLE SDSADM.STD_ASSETTYPE ADD (
  CONSTRAINT PK_STD_ASSETTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ASSETTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ASSETTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ASSETTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ASSETTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ASSETTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ASSETTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_ASSETTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ASSETTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_ASSETTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ASSETTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_ASSETTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ASSETTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ASSETTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ASSETTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_APPLICATIONHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_APPLICATIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_APPLICATIONHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_APPLICATIONHISTORY ON SDSADM.STD_APPLICATIONHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_ApplicationHistory
after DELETE
ON SDSADM.STD_APPLICATIONHISTORY
BEGIN
	-- update the table for STD_ApplicationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ApplicationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_ApplicationHistory
after INSERT
ON SDSADM.STD_APPLICATIONHISTORY
BEGIN
	-- update the table for STD_ApplicationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ApplicationHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_ApplicationHistory
after UPDATE
ON SDSADM.STD_APPLICATIONHISTORY
BEGIN
	-- update the table for STD_ApplicationHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_ApplicationHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_APPLICATIONHISTORY FOR SDSADM.STD_APPLICATIONHISTORY;


ALTER TABLE SDSADM.STD_APPLICATIONHISTORY ADD (
  CONSTRAINT PK_STD_APPLICATIONHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_APPLICATIONHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_APPLICATIONHISTORY ADD (
  CONSTRAINT FKSTD_APPLICATIONHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_APPLICATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_APPLICATIONHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_APPLICATIONHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_APPLICATIONHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_APPLICATIONHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_APPLICATIONHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_APPLICATIONHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_APPLICATIONHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_APPLICATIONHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_APPLICATIONHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_APPLICATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_APPLICATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_APPLICATION
(
  ID                     NUMBER(20)             NOT NULL,
  INSTITUTION_ID         NUMBER(20)             NOT NULL,
  ASSIGNINGAUTHORITY_ID  NUMBER(20)             NOT NULL,
  IDENTIFIERTYPE_ID      NUMBER(20)             NOT NULL,
  DOMAINNAME             VARCHAR2(80 BYTE),
  VERSION                INTEGER                NOT NULL,
  CREATED                TIMESTAMP(6)           NOT NULL,
  UPDATED                TIMESTAMP(6),
  CREATEDBY              VARCHAR2(32 BYTE)      NOT NULL,
  UPDATEDBY              VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_APPLICATION ON SDSADM.STD_APPLICATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Application
after DELETE
ON SDSADM.STD_APPLICATION
BEGIN
	-- update the table for STD_Application operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Application';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Application
after INSERT
ON SDSADM.STD_APPLICATION
BEGIN
	-- update the table for STD_Application operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Application';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Application
after UPDATE
ON SDSADM.STD_APPLICATION
BEGIN
	-- update the table for STD_Application operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Application';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_APPLICATION FOR SDSADM.STD_APPLICATION;


ALTER TABLE SDSADM.STD_APPLICATION ADD (
  CONSTRAINT PK_STD_APPLICATION
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_APPLICATION
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_APPLICATION ADD (
  CONSTRAINT FKSTD_APPLICATIONASSGNNGTHRTY 
  FOREIGN KEY (ASSIGNINGAUTHORITY_ID) 
  REFERENCES SDSADM.STD_ASSIGNINGAUTHORITY (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_APPLICATIONIDNTFRTYP 
  FOREIGN KEY (IDENTIFIERTYPE_ID) 
  REFERENCES SDSADM.STD_IDENTIFIERTYPE (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_APPLICATIONINSTITUTION 
  FOREIGN KEY (INSTITUTION_ID) 
  REFERENCES SDSADM.STD_INSTITUTION (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_APPLICATION TO ADR;

GRANT SELECT ON SDSADM.STD_APPLICATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_APPLICATION TO EESRV;

GRANT SELECT ON SDSADM.STD_APPLICATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_APPLICATION TO LOBR;

GRANT SELECT ON SDSADM.STD_APPLICATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_APPLICATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_APPLICATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_APPLICATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ALLIEDCOUNTRYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ALLIEDCOUNTRYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ALLIEDCOUNTRYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ALLIEDCOUNTRYHISTORY ON SDSADM.STD_ALLIEDCOUNTRYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AlliedCountryHistory
after DELETE
ON SDSADM.STD_ALLIEDCOUNTRYHISTORY
BEGIN
	-- update the table for STD_AlliedCountryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AlliedCountryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AlliedCountryHistory
after INSERT
ON SDSADM.STD_ALLIEDCOUNTRYHISTORY
BEGIN
	-- update the table for STD_AlliedCountryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AlliedCountryHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AlliedCountryHistory
after UPDATE
ON SDSADM.STD_ALLIEDCOUNTRYHISTORY
BEGIN
	-- update the table for STD_AlliedCountryHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AlliedCountryHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ALLIEDCOUNTRYHISTORY FOR SDSADM.STD_ALLIEDCOUNTRYHISTORY;


ALTER TABLE SDSADM.STD_ALLIEDCOUNTRYHISTORY ADD (
  CONSTRAINT PK_STD_ALLIEDCOUNTRYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ALLIEDCOUNTRYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ALLIEDCOUNTRYHISTORY ADD (
  CONSTRAINT FKSTD_ALLIEDCOUNTRYHISTORYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ALLIEDCOUNTRY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ALLIEDCOUNTRYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ALLIEDCOUNTRYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ALLIEDCOUNTRYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ALLIEDCOUNTRY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ALLIEDCOUNTRY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ALLIEDCOUNTRY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(50 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ALLIEDCOUNTRY ON SDSADM.STD_ALLIEDCOUNTRY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ALLIEDCOUNTRYCODE ON SDSADM.STD_ALLIEDCOUNTRY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ALLIEDCOUNTRYNAME ON SDSADM.STD_ALLIEDCOUNTRY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AlliedCountry
after DELETE
ON SDSADM.STD_ALLIEDCOUNTRY
BEGIN
	-- update the table for STD_AlliedCountry operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AlliedCountry';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AlliedCountry
after INSERT
ON SDSADM.STD_ALLIEDCOUNTRY
BEGIN
	-- update the table for STD_AlliedCountry operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AlliedCountry';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AlliedCountry
after UPDATE
ON SDSADM.STD_ALLIEDCOUNTRY
BEGIN
	-- update the table for STD_AlliedCountry operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AlliedCountry';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ALLIEDCOUNTRY FOR SDSADM.STD_ALLIEDCOUNTRY;


ALTER TABLE SDSADM.STD_ALLIEDCOUNTRY ADD (
  CONSTRAINT PK_STD_ALLIEDCOUNTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ALLIEDCOUNTRY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ALLIEDCOUNTRYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ALLIEDCOUNTRYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ALLIEDCOUNTRYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ALLIEDCOUNTRYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ALLIEDCOUNTRY TO ADR;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRY TO EESRV;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ALLIEDCOUNTRY TO LOBR;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ALLIEDCOUNTRY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ALLIEDCOUNTRY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_AGENTORANGELOCNHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_AGENTORANGELOCNHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_AGENTORANGELOCNHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_AGENTORANGELOCNHISTORY ON SDSADM.STD_AGENTORANGELOCNHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AgentOrangeLocnHstry
after DELETE
ON SDSADM.STD_AGENTORANGELOCNHISTORY
BEGIN
	-- update the table for STD_AgentOrangeLocnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AgentOrangeLocnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AgentOrangeLocnHstry
after INSERT
ON SDSADM.STD_AGENTORANGELOCNHISTORY
BEGIN
	-- update the table for STD_AgentOrangeLocnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AgentOrangeLocnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AgentOrangeLocnHstry
after UPDATE
ON SDSADM.STD_AGENTORANGELOCNHISTORY
BEGIN
	-- update the table for STD_AgentOrangeLocnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AgentOrangeLocnHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_AGENTORANGELOCNHISTORY FOR SDSADM.STD_AGENTORANGELOCNHISTORY;


ALTER TABLE SDSADM.STD_AGENTORANGELOCNHISTORY ADD (
  CONSTRAINT PK_STD_AGENTORANGELOCNHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_AGENTORANGELOCNHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_AGENTORANGELOCNHISTORY ADD (
  CONSTRAINT FKSTD_AGENTORANGELOCNHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_AGENTORANGELOCATION (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_AGENTORANGELOCNHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCNHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCNHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCNHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_AGENTORANGELOCNHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCNHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_AGENTORANGELOCNHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCNHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCNHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_AGENTORANGELOCATION
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_AGENTORANGELOCATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_AGENTORANGELOCATION
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(1 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_AGENTORANGELOCN ON SDSADM.STD_AGENTORANGELOCATION
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_AGENTORANGELOCNCODE ON SDSADM.STD_AGENTORANGELOCATION
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_AGENTORANGELOCNNAME ON SDSADM.STD_AGENTORANGELOCATION
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AgentOrangeLocn
after DELETE
ON SDSADM.STD_AGENTORANGELOCATION
BEGIN
	-- update the table for STD_AgentOrangeLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AgentOrangeLocation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AgentOrangeLocn
after INSERT
ON SDSADM.STD_AGENTORANGELOCATION
BEGIN
	-- update the table for STD_AgentOrangeLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AgentOrangeLocation';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AgentOrangeLocn
after UPDATE
ON SDSADM.STD_AGENTORANGELOCATION
BEGIN
	-- update the table for STD_AgentOrangeLocation operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AgentOrangeLocation';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_AGENTORANGELOCATION FOR SDSADM.STD_AGENTORANGELOCATION;


ALTER TABLE SDSADM.STD_AGENTORANGELOCATION ADD (
  CONSTRAINT PK_STD_AGENTORANGELOCN
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_AGENTORANGELOCN
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_AGENTORANGELOCNCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_AGENTORANGELOCNCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_AGENTORANGELOCNNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_AGENTORANGELOCNNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_AGENTORANGELOCATION TO ADR;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCATION TO ADREXT;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCATION TO EESRV;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCATION TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_AGENTORANGELOCATION TO LOBR;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCATION TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_AGENTORANGELOCATION TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCATION TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_AGENTORANGELOCATION TO SDS_SELECT;
ALTER TABLE SDSADM.STD_AGENCYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_AGENCYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_AGENCYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_AGENCYHISTORY ON SDSADM.STD_AGENCYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AgencyHistory
after DELETE
ON SDSADM.STD_AGENCYHISTORY
BEGIN
	-- update the table for STD_AgencyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AgencyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AgencyHistory
after INSERT
ON SDSADM.STD_AGENCYHISTORY
BEGIN
	-- update the table for STD_AgencyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AgencyHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AgencyHistory
after UPDATE
ON SDSADM.STD_AGENCYHISTORY
BEGIN
	-- update the table for STD_AgencyHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AgencyHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_AGENCYHISTORY FOR SDSADM.STD_AGENCYHISTORY;


ALTER TABLE SDSADM.STD_AGENCYHISTORY ADD (
  CONSTRAINT PK_STD_AGENCYHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_AGENCYHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_AGENCYHISTORY ADD (
  CONSTRAINT FKSTD_AGENCYHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_AGENCY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_AGENCYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_AGENCYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_AGENCYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_AGENCYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_AGENCYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_AGENCYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_AGENCYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_AGENCYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_AGENCYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_AGENCY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_AGENCY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_AGENCY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(4 BYTE)                 NOT NULL,
  NAME         VARCHAR2(15 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(60 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_AGENCY ON SDSADM.STD_AGENCY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_AGENCYCODE ON SDSADM.STD_AGENCY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_AGENCYNAME ON SDSADM.STD_AGENCY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_Agency
after DELETE
ON SDSADM.STD_AGENCY
BEGIN
	-- update the table for STD_Agency operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Agency';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_Agency
after INSERT
ON SDSADM.STD_AGENCY
BEGIN
	-- update the table for STD_Agency operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Agency';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_Agency
after UPDATE
ON SDSADM.STD_AGENCY
BEGIN
	-- update the table for STD_Agency operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_Agency';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_AGENCY FOR SDSADM.STD_AGENCY;


ALTER TABLE SDSADM.STD_AGENCY ADD (
  CONSTRAINT PK_STD_AGENCY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_AGENCY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_AGENCYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_AGENCYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_AGENCYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_AGENCYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_AGENCY TO ADR;

GRANT SELECT ON SDSADM.STD_AGENCY TO ADREXT;

GRANT SELECT ON SDSADM.STD_AGENCY TO EESRV;

GRANT SELECT ON SDSADM.STD_AGENCY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_AGENCY TO LOBR;

GRANT SELECT ON SDSADM.STD_AGENCY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_AGENCY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_AGENCY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_AGENCY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_AFFECTEDEXTREMITYHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_AFFECTEDEXTREMITYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_AFFECTEDEXTREMITYHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_AFFECTEDEXTREMITYHSTRY ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AffectedExtrmtyHstry
after DELETE
ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY
BEGIN
	-- update the table for STD_AffectedExtremityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AffectedExtremityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AffectedExtrmtyHstry
after INSERT
ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY
BEGIN
	-- update the table for STD_AffectedExtremityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AffectedExtremityHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AffectedExtrmtyHstry
after UPDATE
ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY
BEGIN
	-- update the table for STD_AffectedExtremityHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AffectedExtremityHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_AFFECTEDEXTREMITYHISTORY FOR SDSADM.STD_AFFECTEDEXTREMITYHISTORY;


ALTER TABLE SDSADM.STD_AFFECTEDEXTREMITYHISTORY ADD (
  CONSTRAINT PK_STD_AFFECTEDEXTREMITYHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_AFFECTEDEXTREMITYHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_AFFECTEDEXTREMITYHISTORY ADD (
  CONSTRAINT FKSTD_AFFECTEDEXTRMTYHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_AFFECTEDEXTREMITY (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITYHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_AFFECTEDEXTREMITY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_AFFECTEDEXTREMITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_AFFECTEDEXTREMITY
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(40 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_AFFECTEDEXTREMITY ON SDSADM.STD_AFFECTEDEXTREMITY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_AFFECTEDEXTREMITYCODE ON SDSADM.STD_AFFECTEDEXTREMITY
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_AFFECTEDEXTREMITYNAME ON SDSADM.STD_AFFECTEDEXTREMITY
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AffectedExtremity
after DELETE
ON SDSADM.STD_AFFECTEDEXTREMITY
BEGIN
	-- update the table for STD_AffectedExtremity operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AffectedExtremity';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AffectedExtremity
after INSERT
ON SDSADM.STD_AFFECTEDEXTREMITY
BEGIN
	-- update the table for STD_AffectedExtremity operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AffectedExtremity';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AffectedExtremity
after UPDATE
ON SDSADM.STD_AFFECTEDEXTREMITY
BEGIN
	-- update the table for STD_AffectedExtremity operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AffectedExtremity';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_AFFECTEDEXTREMITY FOR SDSADM.STD_AFFECTEDEXTREMITY;


ALTER TABLE SDSADM.STD_AFFECTEDEXTREMITY ADD (
  CONSTRAINT PK_STD_AFFECTEDEXTREMITY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_AFFECTEDEXTREMITY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_AFFECTEDEXTREMITYCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_AFFECTEDEXTREMITYCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_AFFECTEDEXTREMITYNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_AFFECTEDEXTREMITYNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_AFFECTEDEXTREMITY TO ADR;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITY TO ADREXT;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITY TO EESRV;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_AFFECTEDEXTREMITY TO LOBR;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_AFFECTEDEXTREMITY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_AFFECTEDEXTREMITY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ADRSINVALRSNHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ADRSINVALRSNHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ADRSINVALRSNHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ADRSINVALRSNHISTORY ON SDSADM.STD_ADRSINVALRSNHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AdrsInvalRsnHistory
after DELETE
ON SDSADM.STD_ADRSINVALRSNHISTORY
BEGIN
	-- update the table for STD_AdrsInvalRsnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AdrsInvalRsnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AdrsInvalRsnHistory
after INSERT
ON SDSADM.STD_ADRSINVALRSNHISTORY
BEGIN
	-- update the table for STD_AdrsInvalRsnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AdrsInvalRsnHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AdrsInvalRsnHistory
after UPDATE
ON SDSADM.STD_ADRSINVALRSNHISTORY
BEGIN
	-- update the table for STD_AdrsInvalRsnHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AdrsInvalRsnHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ADRSINVALRSNHISTORY FOR SDSADM.STD_ADRSINVALRSNHISTORY;


ALTER TABLE SDSADM.STD_ADRSINVALRSNHISTORY ADD (
  CONSTRAINT PK_STD_ADRSINVALRSNHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ADRSINVALRSNHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ADRSINVALRSNHISTORY ADD (
  CONSTRAINT FKSTD_ADRSINVALRSNHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ADDRESSINVALIDREASON (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ADRSINVALRSNHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ADRSINVALRSNHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ADRSINVALRSNHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ADRSINVALRSNHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ADRSINVALRSNHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ADRSINVALRSNHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ADRSINVALRSNHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ADRSINVALRSNHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ADRSINVALRSNHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ADRSDLVRYFLRCDHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ADRSDLVRYFLRCDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ADRSDLVRYFLRCDHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ADRSDLVRYFLRCDHISTORY ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AdrsDlvryFlrCdHistory
after DELETE
ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY
BEGIN
	-- update the table for STD_AdrsDlvryFlrCdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AdrsDlvryFlrCdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AdrsDlvryFlrCdHistory
after INSERT
ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY
BEGIN
	-- update the table for STD_AdrsDlvryFlrCdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AdrsDlvryFlrCdHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AdrsDlvryFlrCdHistory
after UPDATE
ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY
BEGIN
	-- update the table for STD_AdrsDlvryFlrCdHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AdrsDlvryFlrCdHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ADRSDLVRYFLRCDHISTORY FOR SDSADM.STD_ADRSDLVRYFLRCDHISTORY;


ALTER TABLE SDSADM.STD_ADRSDLVRYFLRCDHISTORY ADD (
  CONSTRAINT PK_STD_ADRSDLVRYFLRCDHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ADRSDLVRYFLRCDHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ADRSDLVRYFLRCDHISTORY ADD (
  CONSTRAINT FKSTD_ADRSDLVRYFLRCDHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ADDRESSDELIVERYFAILURECODE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ADRSDLVRYFLRCDHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ADMINISTRATIVEENTITY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ADMINISTRATIVEENTITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ADMINISTRATIVEENTITY
(
  ID                       NUMBER(20)           NOT NULL,
  NAME                     VARCHAR2(80 BYTE)    NOT NULL,
  ADMINISTRATIVEPARENT_ID  NUMBER(20),
  AGENCY_ID                NUMBER(20),
  INSTITUTION_ID           NUMBER(20),
  VERSION                  INTEGER              NOT NULL,
  CREATED                  TIMESTAMP(6)         NOT NULL,
  UPDATED                  TIMESTAMP(6),
  CREATEDBY                VARCHAR2(32 BYTE)    NOT NULL,
  UPDATEDBY                VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_AE ON SDSADM.STD_ADMINISTRATIVEENTITY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_AEAGENCY ON SDSADM.STD_ADMINISTRATIVEENTITY
(AGENCY_ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_AEINSTITUTION ON SDSADM.STD_ADMINISTRATIVEENTITY
(INSTITUTION_ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AE
after DELETE
ON SDSADM.STD_ADMINISTRATIVEENTITY
BEGIN
	-- update the table for STD_AdministrativeEntity operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AdministrativeEntity';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AE
after INSERT
ON SDSADM.STD_ADMINISTRATIVEENTITY
BEGIN
	-- update the table for STD_AdministrativeEntity operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AdministrativeEntity';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AE
after UPDATE
ON SDSADM.STD_ADMINISTRATIVEENTITY
BEGIN
	-- update the table for STD_AdministrativeEntity operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AdministrativeEntity';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ADMINISTRATIVEENTITY FOR SDSADM.STD_ADMINISTRATIVEENTITY;


ALTER TABLE SDSADM.STD_ADMINISTRATIVEENTITY ADD (
  CONSTRAINT PK_STD_AE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_AE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_AEAGENCY
  UNIQUE (AGENCY_ID)
  USING INDEX SDSADM.UQSTD_AEAGENCY
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_AEINSTITUTION
  UNIQUE (INSTITUTION_ID)
  USING INDEX SDSADM.UQSTD_AEINSTITUTION
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ADMINISTRATIVEENTITY ADD (
  CONSTRAINT FKSTD_AEADMINISTRATIVEPARENT 
  FOREIGN KEY (ADMINISTRATIVEPARENT_ID) 
  REFERENCES SDSADM.STD_ADMINISTRATIVEENTITY (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_AEAGENCY 
  FOREIGN KEY (AGENCY_ID) 
  REFERENCES SDSADM.STD_AGENCY (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE,
  CONSTRAINT FKSTD_AEINSTITUTION 
  FOREIGN KEY (INSTITUTION_ID) 
  REFERENCES SDSADM.STD_INSTITUTION (ID)
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ADMINISTRATIVEENTITY TO ADR;

GRANT SELECT ON SDSADM.STD_ADMINISTRATIVEENTITY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ADMINISTRATIVEENTITY TO EESRV;

GRANT SELECT ON SDSADM.STD_ADMINISTRATIVEENTITY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ADMINISTRATIVEENTITY TO LOBR;

GRANT SELECT ON SDSADM.STD_ADMINISTRATIVEENTITY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ADMINISTRATIVEENTITY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ADMINISTRATIVEENTITY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ADMINISTRATIVEENTITY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ADDRESSTYPEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ADDRESSTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ADDRESSTYPEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ADDRESSTYPEHISTORY ON SDSADM.STD_ADDRESSTYPEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AddressTypeHistory
after DELETE
ON SDSADM.STD_ADDRESSTYPEHISTORY
BEGIN
	-- update the table for STD_AddressTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AddressTypeHistory
after INSERT
ON SDSADM.STD_ADDRESSTYPEHISTORY
BEGIN
	-- update the table for STD_AddressTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressTypeHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AddressTypeHistory
after UPDATE
ON SDSADM.STD_ADDRESSTYPEHISTORY
BEGIN
	-- update the table for STD_AddressTypeHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressTypeHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ADDRESSTYPEHISTORY FOR SDSADM.STD_ADDRESSTYPEHISTORY;


ALTER TABLE SDSADM.STD_ADDRESSTYPEHISTORY ADD (
  CONSTRAINT PK_STD_ADDRESSTYPEHISTORY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ADDRESSTYPEHISTORY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ADDRESSTYPEHISTORY ADD (
  CONSTRAINT FKSTD_ADDRESSTYPEHISTORYOWNER 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ADDRESSTYPE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ADDRESSTYPEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ADDRESSTYPEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ADDRESSTYPEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ADDRESSTYPE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ADDRESSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ADDRESSTYPE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(3 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(250 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ADDRESSTYPE ON SDSADM.STD_ADDRESSTYPE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ADDRESSTYPECODE ON SDSADM.STD_ADDRESSTYPE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ADDRESSTYPENAME ON SDSADM.STD_ADDRESSTYPE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AddressType
after DELETE
ON SDSADM.STD_ADDRESSTYPE
BEGIN
	-- update the table for STD_AddressType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AddressType
after INSERT
ON SDSADM.STD_ADDRESSTYPE
BEGIN
	-- update the table for STD_AddressType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressType';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AddressType
after UPDATE
ON SDSADM.STD_ADDRESSTYPE
BEGIN
	-- update the table for STD_AddressType operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressType';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ADDRESSTYPE FOR SDSADM.STD_ADDRESSTYPE;


ALTER TABLE SDSADM.STD_ADDRESSTYPE ADD (
  CONSTRAINT PK_STD_ADDRESSTYPE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ADDRESSTYPE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ADDRESSTYPECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ADDRESSTYPECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ADDRESSTYPENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ADDRESSTYPENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ADDRESSTYPE TO ADR;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPE TO EESRV;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ADDRESSTYPE TO LOBR;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ADDRESSTYPE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ADDRESSTYPE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ADDRESSINVALIDREASON
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ADDRESSINVALIDREASON CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ADDRESSINVALIDREASON
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         NUMBER(10)                       NOT NULL,
  NAME         VARCHAR2(40 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ADRSINVALRSN ON SDSADM.STD_ADDRESSINVALIDREASON
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ADRSINVALRSNCODE ON SDSADM.STD_ADDRESSINVALIDREASON
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ADRSINVALRSNNAME ON SDSADM.STD_ADDRESSINVALIDREASON
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AdrsInvalRsn
after DELETE
ON SDSADM.STD_ADDRESSINVALIDREASON
BEGIN
	-- update the table for STD_AddressInvalidReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressInvalidReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AdrsInvalRsn
after INSERT
ON SDSADM.STD_ADDRESSINVALIDREASON
BEGIN
	-- update the table for STD_AddressInvalidReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressInvalidReason';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AdrsInvalRsn
after UPDATE
ON SDSADM.STD_ADDRESSINVALIDREASON
BEGIN
	-- update the table for STD_AddressInvalidReason operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressInvalidReason';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ADDRESSINVALIDREASON FOR SDSADM.STD_ADDRESSINVALIDREASON;


ALTER TABLE SDSADM.STD_ADDRESSINVALIDREASON ADD (
  CONSTRAINT PK_STD_ADRSINVALRSN
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ADRSINVALRSN
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ADRSINVALRSNCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ADRSINVALRSNCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ADRSINVALRSNNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ADRSINVALRSNNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ADDRESSINVALIDREASON TO ADR;

GRANT SELECT ON SDSADM.STD_ADDRESSINVALIDREASON TO ADREXT;

GRANT SELECT ON SDSADM.STD_ADDRESSINVALIDREASON TO EESRV;

GRANT SELECT ON SDSADM.STD_ADDRESSINVALIDREASON TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ADDRESSINVALIDREASON TO LOBR;

GRANT SELECT ON SDSADM.STD_ADDRESSINVALIDREASON TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ADDRESSINVALIDREASON TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ADDRESSINVALIDREASON TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ADDRESSINVALIDREASON TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ADDRESSDELIVERYFAILURECODE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ADDRESSDELIVERYFAILURECODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ADDRESSDELIVERYFAILURECODE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(30 BYTE)                NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ADRSDLVRYFLRCD ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ADRSDLVRYFLRCDCODE ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ADRSDLVRYFLRCDNAME ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AdrsDlvryFlrCd
after DELETE
ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE
BEGIN
	-- update the table for STD_AddressDeliveryFailureCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressDeliveryFailureCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AdrsDlvryFlrCd
after INSERT
ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE
BEGIN
	-- update the table for STD_AddressDeliveryFailureCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressDeliveryFailureCode';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AdrsDlvryFlrCd
after UPDATE
ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE
BEGIN
	-- update the table for STD_AddressDeliveryFailureCode operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressDeliveryFailureCode';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ADDRESSDELIVERYFAILURECODE FOR SDSADM.STD_ADDRESSDELIVERYFAILURECODE;


ALTER TABLE SDSADM.STD_ADDRESSDELIVERYFAILURECODE ADD (
  CONSTRAINT PK_STD_ADRSDLVRYFLRCD
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ADRSDLVRYFLRCD
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ADRSDLVRYFLRCDCODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ADRSDLVRYFLRCDCODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ADRSDLVRYFLRCDNAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ADRSDLVRYFLRCDNAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO ADR;

GRANT SELECT ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO ADRTMP;

GRANT SELECT ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO EESRV;

GRANT SELECT ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO LOBR;

GRANT SELECT ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ADDRESSDELIVERYFAILURECODE TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ADDRESSCHANGESOURCEHISTORY
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ADDRESSCHANGESOURCEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ADDRESSCHANGESOURCEHISTORY
(
  ID              NUMBER(20)                    NOT NULL,
  OWNER_ID        NUMBER(20)                    NOT NULL,
  ISACTIVE        CHAR(1 BYTE)                  NOT NULL,
  EFFECTIVEDATE   DATE                          NOT NULL,
  EXPIRATIONDATE  DATE                          NOT NULL,
  VERSION         INTEGER                       NOT NULL,
  CREATED         TIMESTAMP(6)                  NOT NULL,
  UPDATED         TIMESTAMP(6),
  CREATEDBY       VARCHAR2(32 BYTE)             NOT NULL,
  UPDATEDBY       VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ADDRESSCHANGESRCHSTRY ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AddressChangeSrcHstry
after DELETE
ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_AddressChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AddressChangeSrcHstry
after INSERT
ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_AddressChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressChangeSourceHistory';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AddressChangeSrcHstry
after UPDATE
ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY
BEGIN
	-- update the table for STD_AddressChangeSourceHistory operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressChangeSourceHistory';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ADDRESSCHANGESOURCEHISTORY FOR SDSADM.STD_ADDRESSCHANGESOURCEHISTORY;


ALTER TABLE SDSADM.STD_ADDRESSCHANGESOURCEHISTORY ADD (
  CONSTRAINT PK_STD_ADDRESSCHANGESRCHSTRY
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ADDRESSCHANGESRCHSTRY
  ENABLE VALIDATE);

ALTER TABLE SDSADM.STD_ADDRESSCHANGESOURCEHISTORY ADD (
  CONSTRAINT FKSTD_ADDRESSCHNGSRCHSTRYOWNR 
  FOREIGN KEY (OWNER_ID) 
  REFERENCES SDSADM.STD_ADDRESSCHANGESOURCE (ID)
  ON DELETE CASCADE
  DEFERRABLE INITIALLY DEFERRED
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY TO ADR;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY TO ADREXT;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY TO EESRV;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY TO LOBR;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCEHISTORY TO SDS_SELECT;
ALTER TABLE SDSADM.STD_ADDRESSCHANGESOURCE
 DROP PRIMARY KEY CASCADE;

DROP TABLE SDSADM.STD_ADDRESSCHANGESOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.STD_ADDRESSCHANGESOURCE
(
  ID           NUMBER(20)                       NOT NULL,
  CODE         VARCHAR2(5 BYTE)                 NOT NULL,
  NAME         VARCHAR2(30 BYTE)                NOT NULL,
  DESCRIPTION  VARCHAR2(100 BYTE),
  VERSION      INTEGER                          NOT NULL,
  CREATED      TIMESTAMP(6)                     NOT NULL,
  UPDATED      TIMESTAMP(6),
  CREATEDBY    VARCHAR2(32 BYTE)                NOT NULL,
  UPDATEDBY    VARCHAR2(32 BYTE)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX SDSADM.PK_STD_ADDRESSCHANGESOURCE ON SDSADM.STD_ADDRESSCHANGESOURCE
(ID)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ADDRESSCHANGESOURCECODE ON SDSADM.STD_ADDRESSCHANGESOURCE
(CODE)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE UNIQUE INDEX SDSADM.UQSTD_ADDRESSCHANGESOURCENAME ON SDSADM.STD_ADDRESSCHANGESOURCE
(NAME)
LOGGING
TABLESPACE S_INDEX_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

CREATE OR REPLACE TRIGGER SDSADM.del4_STD_AddressChangeSource
after DELETE
ON SDSADM.STD_ADDRESSCHANGESOURCE
BEGIN
	-- update the table for STD_AddressChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.ins4_STD_AddressChangeSource
after INSERT
ON SDSADM.STD_ADDRESSCHANGESOURCE
BEGIN
	-- update the table for STD_AddressChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressChangeSource';
END;
/


CREATE OR REPLACE TRIGGER SDSADM.upd4_STD_AddressChangeSource
after UPDATE
ON SDSADM.STD_ADDRESSCHANGESOURCE
BEGIN
	-- update the table for STD_AddressChangeSource operation
	UPDATE STD_TableManager
	SET lastUpdated = CURRENT_TIMESTAMP
	WHERE tableName = 'STD_AddressChangeSource';
END;
/


CREATE OR REPLACE PUBLIC SYNONYM STD_ADDRESSCHANGESOURCE FOR SDSADM.STD_ADDRESSCHANGESOURCE;


ALTER TABLE SDSADM.STD_ADDRESSCHANGESOURCE ADD (
  CONSTRAINT PK_STD_ADDRESSCHANGESOURCE
  PRIMARY KEY
  (ID)
  USING INDEX SDSADM.PK_STD_ADDRESSCHANGESOURCE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ADDRESSCHANGESOURCECODE
  UNIQUE (CODE)
  USING INDEX SDSADM.UQSTD_ADDRESSCHANGESOURCECODE
  ENABLE VALIDATE,
  CONSTRAINT UQSTD_ADDRESSCHANGESOURCENAME
  UNIQUE (NAME)
  USING INDEX SDSADM.UQSTD_ADDRESSCHANGESOURCENAME
  ENABLE VALIDATE);

GRANT REFERENCES ON SDSADM.STD_ADDRESSCHANGESOURCE TO ADR;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCE TO ADREXT;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCE TO EESRV;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCE TO EEUSR WITH GRANT OPTION;

GRANT REFERENCES ON SDSADM.STD_ADDRESSCHANGESOURCE TO LOBR;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCE TO PSIM;

GRANT INSERT, SELECT, UPDATE ON SDSADM.STD_ADDRESSCHANGESOURCE TO SDS_EDIT;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCE TO SDS_PROXY;

GRANT SELECT ON SDSADM.STD_ADDRESSCHANGESOURCE TO SDS_SELECT;
DROP TABLE SDSADM.RUPD$_STD_ZIPTOMSAHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPTOMSAHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPTOMSAHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPTOMSAHISTORY FOR SDSADM.RUPD$_STD_ZIPTOMSAHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPTOMSAHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPTOMSA CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPTOMSA
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPTOMSA IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPTOMSA FOR SDSADM.RUPD$_STD_ZIPTOMSA;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPTOMSA TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPPLACEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPPLACEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPPLACEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPPLACEHISTORY FOR SDSADM.RUPD$_STD_ZIPPLACEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPPLACEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPPLACEFACILITY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPPLACEFACILITY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPPLACEFACILITY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPPLACEFACILITY1 FOR SDSADM.RUPD$_STD_ZIPPLACEFACILITY1;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPPLACEFACILITY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPPLACEFACILITY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPPLACEFACILITY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPPLACEFACILITY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPPLACEFACILITY FOR SDSADM.RUPD$_STD_ZIPPLACEFACILITY;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPPLACEFACILITY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPPLACE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPPLACE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPPLACE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPPLACE FOR SDSADM.RUPD$_STD_ZIPPLACE;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPPLACE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPCODEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPCODEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPCODEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPCODEHISTORY FOR SDSADM.RUPD$_STD_ZIPCODEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPCODEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPCODE FOR SDSADM.RUPD$_STD_ZIPCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPCLASSIFICATIO1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPCLASSIFICATIO1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPCLASSIFICATIO1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPCLASSIFICATIO1 FOR SDSADM.RUPD$_STD_ZIPCLASSIFICATIO1;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPCLASSIFICATIO1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPCLASSIFICATIO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPCLASSIFICATIO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPCLASSIFICATIO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPCLASSIFICATIO FOR SDSADM.RUPD$_STD_ZIPCLASSIFICATIO;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPCLASSIFICATIO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ZIPASSIGNMENT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ZIPASSIGNMENT
(
  ZIPCODE_ID       NUMBER(20),
  ZIPPLACE_ID      NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ZIPASSIGNMENT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ZIPASSIGNMENT FOR SDSADM.RUPD$_STD_ZIPASSIGNMENT;


GRANT SELECT ON SDSADM.RUPD$_STD_ZIPASSIGNMENT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_YESNOCODEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_YESNOCODEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_YESNOCODEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_YESNOCODEHISTORY FOR SDSADM.RUPD$_STD_YESNOCODEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_YESNOCODEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_YESNOCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_YESNOCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_YESNOCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_YESNOCODE FOR SDSADM.RUPD$_STD_YESNOCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_YESNOCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_VBAQUERYSTATUSTY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_VBAQUERYSTATUSTY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_VBAQUERYSTATUSTY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_VBAQUERYSTATUSTY1 FOR SDSADM.RUPD$_STD_VBAQUERYSTATUSTY1;


GRANT SELECT ON SDSADM.RUPD$_STD_VBAQUERYSTATUSTY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_VBAQUERYSTATUSTY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_VBAQUERYSTATUSTY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_VBAQUERYSTATUSTY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_VBAQUERYSTATUSTY FOR SDSADM.RUPD$_STD_VBAQUERYSTATUSTY;


GRANT SELECT ON SDSADM.RUPD$_STD_VBAQUERYSTATUSTY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_USERGROUPTYPEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_USERGROUPTYPEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_USERGROUPTYPEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_USERGROUPTYPEHIS FOR SDSADM.RUPD$_STD_USERGROUPTYPEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_USERGROUPTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_USERGROUPTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_USERGROUPTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_USERGROUPTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_USERGROUPTYPE FOR SDSADM.RUPD$_STD_USERGROUPTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_USERGROUPTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_TRANSACTIONTYPEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_TRANSACTIONTYPEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_TRANSACTIONTYPEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_TRANSACTIONTYPEH FOR SDSADM.RUPD$_STD_TRANSACTIONTYPEH;


GRANT SELECT ON SDSADM.RUPD$_STD_TRANSACTIONTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_TRANSACTIONTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_TRANSACTIONTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_TRANSACTIONTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_TRANSACTIONTYPE FOR SDSADM.RUPD$_STD_TRANSACTIONTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_TRANSACTIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_TERMINATIONREASO1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_TERMINATIONREASO1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_TERMINATIONREASO1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_TERMINATIONREASO1 FOR SDSADM.RUPD$_STD_TERMINATIONREASO1;


GRANT SELECT ON SDSADM.RUPD$_STD_TERMINATIONREASO1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_TERMINATIONREASO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_TERMINATIONREASO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_TERMINATIONREASO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_TERMINATIONREASO FOR SDSADM.RUPD$_STD_TERMINATIONREASO;


GRANT SELECT ON SDSADM.RUPD$_STD_TERMINATIONREASO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SVCDSCHRGCDHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SVCDSCHRGCDHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SVCDSCHRGCDHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SVCDSCHRGCDHISTO FOR SDSADM.RUPD$_STD_SVCDSCHRGCDHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_SVCDSCHRGCDHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_STATISTICALAREAT1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_STATISTICALAREAT1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_STATISTICALAREAT1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_STATISTICALAREAT1 FOR SDSADM.RUPD$_STD_STATISTICALAREAT1;


GRANT SELECT ON SDSADM.RUPD$_STD_STATISTICALAREAT1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_STATISTICALAREAT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_STATISTICALAREAT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_STATISTICALAREAT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_STATISTICALAREAT FOR SDSADM.RUPD$_STD_STATISTICALAREAT;


GRANT SELECT ON SDSADM.RUPD$_STD_STATISTICALAREAT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_STATISTICALAREAH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_STATISTICALAREAH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_STATISTICALAREAH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_STATISTICALAREAH FOR SDSADM.RUPD$_STD_STATISTICALAREAH;


GRANT SELECT ON SDSADM.RUPD$_STD_STATISTICALAREAH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_STATISTICALAREA CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_STATISTICALAREA
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_STATISTICALAREA IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_STATISTICALAREA FOR SDSADM.RUPD$_STD_STATISTICALAREA;


GRANT SELECT ON SDSADM.RUPD$_STD_STATISTICALAREA TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_STATEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_STATEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_STATEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_STATEHISTORY FOR SDSADM.RUPD$_STD_STATEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_STATEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_STATE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_STATE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_STATE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_STATE FOR SDSADM.RUPD$_STD_STATE;


GRANT SELECT ON SDSADM.RUPD$_STD_STATE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_STATCNTYXREF CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_STATCNTYXREF
(
  COUNTY_ID           NUMBER(20),
  STATISTICALAREA_ID  NUMBER(20),
  DMLTYPE$$           VARCHAR2(1 BYTE),
  SNAPID              INTEGER,
  CHANGE_VECTOR$$     RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_STATCNTYXREF IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_STATCNTYXREF FOR SDSADM.RUPD$_STD_STATCNTYXREF;


GRANT SELECT ON SDSADM.RUPD$_STD_STATCNTYXREF TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSNVERIFSTATUSHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSNVERIFSTATUSHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSNVERIFSTATUSHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSNVERIFSTATUSHI FOR SDSADM.RUPD$_STD_SSNVERIFSTATUSHI;


GRANT SELECT ON SDSADM.RUPD$_STD_SSNVERIFSTATUSHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSNVERIFICATIONS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSNVERIFICATIONS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSNVERIFICATIONS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSNVERIFICATIONS FOR SDSADM.RUPD$_STD_SSNVERIFICATIONS;


GRANT SELECT ON SDSADM.RUPD$_STD_SSNVERIFICATIONS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSNTYPEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSNTYPEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSNTYPEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSNTYPEHISTORY FOR SDSADM.RUPD$_STD_SSNTYPEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_SSNTYPEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSNTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSNTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSNTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSNTYPE FOR SDSADM.RUPD$_STD_SSNTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_SSNTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSNCHANGESOURCEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSNCHANGESOURCEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSNCHANGESOURCEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSNCHANGESOURCEH FOR SDSADM.RUPD$_STD_SSNCHANGESOURCEH;


GRANT SELECT ON SDSADM.RUPD$_STD_SSNCHANGESOURCEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSNCHANGESOURCE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSNCHANGESOURCE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSNCHANGESOURCE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSNCHANGESOURCE FOR SDSADM.RUPD$_STD_SSNCHANGESOURCE;


GRANT SELECT ON SDSADM.RUPD$_STD_SSNCHANGESOURCE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSAVERIFCODEHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSAVERIFCODEHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSAVERIFCODEHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSAVERIFCODEHIST FOR SDSADM.RUPD$_STD_SSAVERIFCODEHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_SSAVERIFCODEHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSAVERIFCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSAVERIFCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSAVERIFCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSAVERIFCODE FOR SDSADM.RUPD$_STD_SSAVERIFCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_SSAVERIFCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSAMESSAGETYPEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSAMESSAGETYPEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSAMESSAGETYPEHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSAMESSAGETYPEHI FOR SDSADM.RUPD$_STD_SSAMESSAGETYPEHI;


GRANT SELECT ON SDSADM.RUPD$_STD_SSAMESSAGETYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SSAMESSAGETYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SSAMESSAGETYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SSAMESSAGETYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SSAMESSAGETYPE FOR SDSADM.RUPD$_STD_SSAMESSAGETYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_SSAMESSAGETYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SPINALINJURYCODE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SPINALINJURYCODE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SPINALINJURYCODE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SPINALINJURYCODE1 FOR SDSADM.RUPD$_STD_SPINALINJURYCODE1;


GRANT SELECT ON SDSADM.RUPD$_STD_SPINALINJURYCODE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SPINALINJURYCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SPINALINJURYCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SPINALINJURYCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SPINALINJURYCODE FOR SDSADM.RUPD$_STD_SPINALINJURYCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_SPINALINJURYCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SPECIALTYSERVICE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SPECIALTYSERVICE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SPECIALTYSERVICE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SPECIALTYSERVICE1 FOR SDSADM.RUPD$_STD_SPECIALTYSERVICE1;


GRANT SELECT ON SDSADM.RUPD$_STD_SPECIALTYSERVICE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SPECIALTYSERVICE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SPECIALTYSERVICE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SPECIALTYSERVICE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SPECIALTYSERVICE FOR SDSADM.RUPD$_STD_SPECIALTYSERVICE;


GRANT SELECT ON SDSADM.RUPD$_STD_SPECIALTYSERVICE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SPECIALOPERATION1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SPECIALOPERATION1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SPECIALOPERATION1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SPECIALOPERATION1 FOR SDSADM.RUPD$_STD_SPECIALOPERATION1;


GRANT SELECT ON SDSADM.RUPD$_STD_SPECIALOPERATION1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SPECIALOPERATION CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SPECIALOPERATION
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SPECIALOPERATION IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SPECIALOPERATION FOR SDSADM.RUPD$_STD_SPECIALOPERATION;


GRANT SELECT ON SDSADM.RUPD$_STD_SPECIALOPERATION TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SPECIALFACTORMAP1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SPECIALFACTORMAP1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SPECIALFACTORMAP1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SPECIALFACTORMAP1 FOR SDSADM.RUPD$_STD_SPECIALFACTORMAP1;


GRANT SELECT ON SDSADM.RUPD$_STD_SPECIALFACTORMAP1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SPECIALFACTORMAP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SPECIALFACTORMAP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SPECIALFACTORMAP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SPECIALFACTORMAP FOR SDSADM.RUPD$_STD_SPECIALFACTORMAP;


GRANT SELECT ON SDSADM.RUPD$_STD_SPECIALFACTORMAP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SITEUPLOADSTATUS1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SITEUPLOADSTATUS1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SITEUPLOADSTATUS1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SITEUPLOADSTATUS1 FOR SDSADM.RUPD$_STD_SITEUPLOADSTATUS1;


GRANT SELECT ON SDSADM.RUPD$_STD_SITEUPLOADSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SITEUPLOADSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SITEUPLOADSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SITEUPLOADSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SITEUPLOADSTATUS FOR SDSADM.RUPD$_STD_SITEUPLOADSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_SITEUPLOADSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SIGNATUREINDTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SIGNATUREINDTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SIGNATUREINDTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SIGNATUREINDTYPE1 FOR SDSADM.RUPD$_STD_SIGNATUREINDTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_SIGNATUREINDTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SIGNATUREINDTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SIGNATUREINDTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SIGNATUREINDTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SIGNATUREINDTYPE FOR SDSADM.RUPD$_STD_SIGNATUREINDTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_SIGNATUREINDTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SHADDOCUMENTTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SHADDOCUMENTTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SHADDOCUMENTTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SHADDOCUMENTTYPE1 FOR SDSADM.RUPD$_STD_SHADDOCUMENTTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_SHADDOCUMENTTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SHADDOCUMENTTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SHADDOCUMENTTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SHADDOCUMENTTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SHADDOCUMENTTYPE FOR SDSADM.RUPD$_STD_SHADDOCUMENTTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_SHADDOCUMENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SERVICEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SERVICEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SERVICEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SERVICEHISTORY FOR SDSADM.RUPD$_STD_SERVICEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_SERVICEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SERVICEDISCHARGE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SERVICEDISCHARGE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SERVICEDISCHARGE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SERVICEDISCHARGE FOR SDSADM.RUPD$_STD_SERVICEDISCHARGE;


GRANT SELECT ON SDSADM.RUPD$_STD_SERVICEDISCHARGE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SERVICEBRANCHHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SERVICEBRANCHHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SERVICEBRANCHHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SERVICEBRANCHHIS FOR SDSADM.RUPD$_STD_SERVICEBRANCHHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_SERVICEBRANCHHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SERVICEBRANCH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SERVICEBRANCH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SERVICEBRANCH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SERVICEBRANCH FOR SDSADM.RUPD$_STD_SERVICEBRANCH;


GRANT SELECT ON SDSADM.RUPD$_STD_SERVICEBRANCH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SERVICE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SERVICE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SERVICE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SERVICE FOR SDSADM.RUPD$_STD_SERVICE;


GRANT SELECT ON SDSADM.RUPD$_STD_SERVICE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SENSITIVITYCHNGS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SENSITIVITYCHNGS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SENSITIVITYCHNGS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SENSITIVITYCHNGS FOR SDSADM.RUPD$_STD_SENSITIVITYCHNGS;


GRANT SELECT ON SDSADM.RUPD$_STD_SENSITIVITYCHNGS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SENSITIVITYCHANG CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SENSITIVITYCHANG
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SENSITIVITYCHANG IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SENSITIVITYCHANG FOR SDSADM.RUPD$_STD_SENSITIVITYCHANG;


GRANT SELECT ON SDSADM.RUPD$_STD_SENSITIVITYCHANG TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SEEDSTATUSCODEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SEEDSTATUSCODEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SEEDSTATUSCODEHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SEEDSTATUSCODEHI FOR SDSADM.RUPD$_STD_SEEDSTATUSCODEHI;


GRANT SELECT ON SDSADM.RUPD$_STD_SEEDSTATUSCODEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_SEEDSTATUSCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_SEEDSTATUSCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_SEEDSTATUSCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_SEEDSTATUSCODE FOR SDSADM.RUPD$_STD_SEEDSTATUSCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_SEEDSTATUSCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELTOVETINSURANC1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELTOVETINSURANC1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELTOVETINSURANC1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELTOVETINSURANC1 FOR SDSADM.RUPD$_STD_RELTOVETINSURANC1;


GRANT SELECT ON SDSADM.RUPD$_STD_RELTOVETINSURANC1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELTOVETINSURANC CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELTOVETINSURANC
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELTOVETINSURANC IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELTOVETINSURANC FOR SDSADM.RUPD$_STD_RELTOVETINSURANC;


GRANT SELECT ON SDSADM.RUPD$_STD_RELTOVETINSURANC TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELIGIONHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELIGIONHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELIGIONHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELIGIONHISTORY FOR SDSADM.RUPD$_STD_RELIGIONHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_RELIGIONHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELIGION CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELIGION
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELIGION IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELIGION FOR SDSADM.RUPD$_STD_RELIGION;


GRANT SELECT ON SDSADM.RUPD$_STD_RELIGION TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELATNLOPERATORH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELATNLOPERATORH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELATNLOPERATORH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELATNLOPERATORH FOR SDSADM.RUPD$_STD_RELATNLOPERATORH;


GRANT SELECT ON SDSADM.RUPD$_STD_RELATNLOPERATORH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELATNLCONJUNCTN CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELATNLCONJUNCTN
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELATNLCONJUNCTN IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELATNLCONJUNCTN FOR SDSADM.RUPD$_STD_RELATNLCONJUNCTN;


GRANT SELECT ON SDSADM.RUPD$_STD_RELATNLCONJUNCTN TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELATIONSHIPHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELATIONSHIPHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELATIONSHIPHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELATIONSHIPHIST FOR SDSADM.RUPD$_STD_RELATIONSHIPHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_RELATIONSHIPHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELATIONSHIP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELATIONSHIP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELATIONSHIP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELATIONSHIP FOR SDSADM.RUPD$_STD_RELATIONSHIP;


GRANT SELECT ON SDSADM.RUPD$_STD_RELATIONSHIP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELATIONALOPERAT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELATIONALOPERAT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELATIONALOPERAT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELATIONALOPERAT FOR SDSADM.RUPD$_STD_RELATIONALOPERAT;


GRANT SELECT ON SDSADM.RUPD$_STD_RELATIONALOPERAT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RELATIONALCONJUN CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RELATIONALCONJUN
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RELATIONALCONJUN IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RELATIONALCONJUN FOR SDSADM.RUPD$_STD_RELATIONALCONJUN;


GRANT SELECT ON SDSADM.RUPD$_STD_RELATIONALCONJUN TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_REJECTEDREMARKSH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_REJECTEDREMARKSH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_REJECTEDREMARKSH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_REJECTEDREMARKSH FOR SDSADM.RUPD$_STD_REJECTEDREMARKSH;


GRANT SELECT ON SDSADM.RUPD$_STD_REJECTEDREMARKSH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_REJECTEDREMARKS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_REJECTEDREMARKS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_REJECTEDREMARKS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_REJECTEDREMARKS FOR SDSADM.RUPD$_STD_REJECTEDREMARKS;


GRANT SELECT ON SDSADM.RUPD$_STD_REJECTEDREMARKS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_REGISTRYTYPEHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_REGISTRYTYPEHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_REGISTRYTYPEHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_REGISTRYTYPEHIST FOR SDSADM.RUPD$_STD_REGISTRYTYPEHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_REGISTRYTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_REGISTRYTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_REGISTRYTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_REGISTRYTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_REGISTRYTYPE FOR SDSADM.RUPD$_STD_REGISTRYTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_REGISTRYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RADIATNEXPSRMTHD CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RADIATNEXPSRMTHD
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RADIATNEXPSRMTHD IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RADIATNEXPSRMTHD FOR SDSADM.RUPD$_STD_RADIATNEXPSRMTHD;


GRANT SELECT ON SDSADM.RUPD$_STD_RADIATNEXPSRMTHD TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RADIATIONEXPOSUR CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RADIATIONEXPOSUR
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RADIATIONEXPOSUR IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RADIATIONEXPOSUR FOR SDSADM.RUPD$_STD_RADIATIONEXPOSUR;


GRANT SELECT ON SDSADM.RUPD$_STD_RADIATIONEXPOSUR TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RACEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RACEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RACEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RACEHISTORY FOR SDSADM.RUPD$_STD_RACEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_RACEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_RACE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_RACE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_RACE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_RACE FOR SDSADM.RUPD$_STD_RACE;


GRANT SELECT ON SDSADM.RUPD$_STD_RACE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PUBLICATIONTOPIC1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PUBLICATIONTOPIC1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PUBLICATIONTOPIC1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PUBLICATIONTOPIC1 FOR SDSADM.RUPD$_STD_PUBLICATIONTOPIC1;


GRANT SELECT ON SDSADM.RUPD$_STD_PUBLICATIONTOPIC1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PUBLICATIONTOPIC CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PUBLICATIONTOPIC
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PUBLICATIONTOPIC IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PUBLICATIONTOPIC FOR SDSADM.RUPD$_STD_PUBLICATIONTOPIC;


GRANT SELECT ON SDSADM.RUPD$_STD_PUBLICATIONTOPIC TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PTFDISCHARGECODE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PTFDISCHARGECODE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PTFDISCHARGECODE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PTFDISCHARGECODE1 FOR SDSADM.RUPD$_STD_PTFDISCHARGECODE1;


GRANT SELECT ON SDSADM.RUPD$_STD_PTFDISCHARGECODE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PTFDISCHARGECODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PTFDISCHARGECODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PTFDISCHARGECODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PTFDISCHARGECODE FOR SDSADM.RUPD$_STD_PTFDISCHARGECODE;


GRANT SELECT ON SDSADM.RUPD$_STD_PTFDISCHARGECODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PSEUDOSSNREASONH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PSEUDOSSNREASONH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PSEUDOSSNREASONH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PSEUDOSSNREASONH FOR SDSADM.RUPD$_STD_PSEUDOSSNREASONH;


GRANT SELECT ON SDSADM.RUPD$_STD_PSEUDOSSNREASONH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PSEUDOSSNREASON CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PSEUDOSSNREASON
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PSEUDOSSNREASON IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PSEUDOSSNREASON FOR SDSADM.RUPD$_STD_PSEUDOSSNREASON;


GRANT SELECT ON SDSADM.RUPD$_STD_PSEUDOSSNREASON TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PROGRAMOFSTUDYHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PROGRAMOFSTUDYHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PROGRAMOFSTUDYHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PROGRAMOFSTUDYHI FOR SDSADM.RUPD$_STD_PROGRAMOFSTUDYHI;


GRANT SELECT ON SDSADM.RUPD$_STD_PROGRAMOFSTUDYHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PROGRAMOFSTUDY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PROGRAMOFSTUDY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PROGRAMOFSTUDY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PROGRAMOFSTUDY FOR SDSADM.RUPD$_STD_PROGRAMOFSTUDY;


GRANT SELECT ON SDSADM.RUPD$_STD_PROGRAMOFSTUDY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PROCEDURECODEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PROCEDURECODEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PROCEDURECODEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PROCEDURECODEHIS FOR SDSADM.RUPD$_STD_PROCEDURECODEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_PROCEDURECODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PROCEDURECODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PROCEDURECODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PROCEDURECODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PROCEDURECODE FOR SDSADM.RUPD$_STD_PROCEDURECODE;


GRANT SELECT ON SDSADM.RUPD$_STD_PROCEDURECODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PRIMCARETMPURPCO1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PRIMCARETMPURPCO1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PRIMCARETMPURPCO1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PRIMCARETMPURPCO1 FOR SDSADM.RUPD$_STD_PRIMCARETMPURPCO1;


GRANT SELECT ON SDSADM.RUPD$_STD_PRIMCARETMPURPCO1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PRIMCARETMPURPCO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PRIMCARETMPURPCO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PRIMCARETMPURPCO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PRIMCARETMPURPCO FOR SDSADM.RUPD$_STD_PRIMCARETMPURPCO;


GRANT SELECT ON SDSADM.RUPD$_STD_PRIMCARETMPURPCO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PREFFACSRCDESIGH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PREFFACSRCDESIGH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PREFFACSRCDESIGH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PREFFACSRCDESIGH FOR SDSADM.RUPD$_STD_PREFFACSRCDESIGH;


GRANT SELECT ON SDSADM.RUPD$_STD_PREFFACSRCDESIGH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PREFFACSRCDESIG CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PREFFACSRCDESIG
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PREFFACSRCDESIG IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PREFFACSRCDESIG FOR SDSADM.RUPD$_STD_PREFFACSRCDESIG;


GRANT SELECT ON SDSADM.RUPD$_STD_PREFFACSRCDESIG TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWPERIODHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWPERIODHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWPERIODHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWPERIODHISTORY FOR SDSADM.RUPD$_STD_POWPERIODHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_POWPERIODHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWPERIOD CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWPERIOD
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWPERIOD IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWPERIOD FOR SDSADM.RUPD$_STD_POWPERIOD;


GRANT SELECT ON SDSADM.RUPD$_STD_POWPERIOD TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWDOCUMENTTYPEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWDOCUMENTTYPEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWDOCUMENTTYPEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWDOCUMENTTYPEH FOR SDSADM.RUPD$_STD_POWDOCUMENTTYPEH;


GRANT SELECT ON SDSADM.RUPD$_STD_POWDOCUMENTTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWDOCUMENTTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWDOCUMENTTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWDOCUMENTTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWDOCUMENTTYPE FOR SDSADM.RUPD$_STD_POWDOCUMENTTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_POWDOCUMENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWDATASOURCETYP1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWDATASOURCETYP1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWDATASOURCETYP1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWDATASOURCETYP1 FOR SDSADM.RUPD$_STD_POWDATASOURCETYP1;


GRANT SELECT ON SDSADM.RUPD$_STD_POWDATASOURCETYP1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWDATASOURCETYP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWDATASOURCETYP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWDATASOURCETYP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWDATASOURCETYP FOR SDSADM.RUPD$_STD_POWDATASOURCETYP;


GRANT SELECT ON SDSADM.RUPD$_STD_POWDATASOURCETYP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWCONFINELOCNTY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWCONFINELOCNTY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWCONFINELOCNTY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWCONFINELOCNTY1 FOR SDSADM.RUPD$_STD_POWCONFINELOCNTY1;


GRANT SELECT ON SDSADM.RUPD$_STD_POWCONFINELOCNTY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWCONFINELOCNTY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWCONFINELOCNTY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWCONFINELOCNTY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWCONFINELOCNTY FOR SDSADM.RUPD$_STD_POWCONFINELOCNTY;


GRANT SELECT ON SDSADM.RUPD$_STD_POWCONFINELOCNTY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWCASUALTYLOCAT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWCASUALTYLOCAT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWCASUALTYLOCAT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWCASUALTYLOCAT FOR SDSADM.RUPD$_STD_POWCASUALTYLOCAT;


GRANT SELECT ON SDSADM.RUPD$_STD_POWCASUALTYLOCAT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POWCASLOCNHISTOR CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POWCASLOCNHISTOR
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POWCASLOCNHISTOR IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POWCASLOCNHISTOR FOR SDSADM.RUPD$_STD_POWCASLOCNHISTOR;


GRANT SELECT ON SDSADM.RUPD$_STD_POWCASLOCNHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POLICYHOLDERTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POLICYHOLDERTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POLICYHOLDERTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POLICYHOLDERTYPE1 FOR SDSADM.RUPD$_STD_POLICYHOLDERTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_POLICYHOLDERTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_POLICYHOLDERTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_POLICYHOLDERTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_POLICYHOLDERTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_POLICYHOLDERTYPE FOR SDSADM.RUPD$_STD_POLICYHOLDERTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_POLICYHOLDERTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PLANCATEGORYTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PLANCATEGORYTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PLANCATEGORYTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PLANCATEGORYTYPE1 FOR SDSADM.RUPD$_STD_PLANCATEGORYTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_PLANCATEGORYTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PLANCATEGORYTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PLANCATEGORYTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PLANCATEGORYTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PLANCATEGORYTYPE FOR SDSADM.RUPD$_STD_PLANCATEGORYTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_PLANCATEGORYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PLACEOFADMISSION1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PLACEOFADMISSION1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PLACEOFADMISSION1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PLACEOFADMISSION1 FOR SDSADM.RUPD$_STD_PLACEOFADMISSION1;


GRANT SELECT ON SDSADM.RUPD$_STD_PLACEOFADMISSION1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PLACEOFADMISSION CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PLACEOFADMISSION
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PLACEOFADMISSION IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PLACEOFADMISSION FOR SDSADM.RUPD$_STD_PLACEOFADMISSION;


GRANT SELECT ON SDSADM.RUPD$_STD_PLACEOFADMISSION TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PHONECONTACTTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PHONECONTACTTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PHONECONTACTTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PHONECONTACTTYPE1 FOR SDSADM.RUPD$_STD_PHONECONTACTTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_PHONECONTACTTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PHONECONTACTTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PHONECONTACTTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PHONECONTACTTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PHONECONTACTTYPE FOR SDSADM.RUPD$_STD_PHONECONTACTTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_PHONECONTACTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PHONECHANGESOURC1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PHONECHANGESOURC1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PHONECHANGESOURC1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PHONECHANGESOURC1 FOR SDSADM.RUPD$_STD_PHONECHANGESOURC1;


GRANT SELECT ON SDSADM.RUPD$_STD_PHONECHANGESOURC1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PHONECHANGESOURC CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PHONECHANGESOURC
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PHONECHANGESOURC IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PHONECHANGESOURC FOR SDSADM.RUPD$_STD_PHONECHANGESOURC;


GRANT SELECT ON SDSADM.RUPD$_STD_PHONECHANGESOURC TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PHDATASRCTYPEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PHDATASRCTYPEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PHDATASRCTYPEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PHDATASRCTYPEHIS FOR SDSADM.RUPD$_STD_PHDATASRCTYPEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_PHDATASRCTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PHDATASRCTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PHDATASRCTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PHDATASRCTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PHDATASRCTYPE FOR SDSADM.RUPD$_STD_PHDATASRCTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_PHDATASRCTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONRELATIONHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONRELATIONHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONRELATIONHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONRELATIONHI FOR SDSADM.RUPD$_STD_PERSONRELATIONHI;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONRELATIONHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONRELATION CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONRELATION
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONRELATION IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONRELATION FOR SDSADM.RUPD$_STD_PERSONRELATION;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONRELATION TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONMERGESTATU1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONMERGESTATU1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONMERGESTATU1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONMERGESTATU1 FOR SDSADM.RUPD$_STD_PERSONMERGESTATU1;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONMERGESTATU1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONMERGESTATU CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONMERGESTATU
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONMERGESTATU IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONMERGESTATU FOR SDSADM.RUPD$_STD_PERSONMERGESTATU;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONMERGESTATU TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCONTACTTYP1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCONTACTTYP1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCONTACTTYP1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCONTACTTYP1 FOR SDSADM.RUPD$_STD_PERSONCONTACTTYP1;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCONTACTTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCONTACTTYP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCONTACTTYP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCONTACTTYP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCONTACTTYP FOR SDSADM.RUPD$_STD_PERSONCONTACTTYP;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCONTACTTYP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCLASSPTHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCLASSPTHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCLASSPTHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCLASSPTHIS FOR SDSADM.RUPD$_STD_PERSONCLASSPTHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCLASSPTHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCLASSPROVI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCLASSPROVI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCLASSPROVI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCLASSPROVI FOR SDSADM.RUPD$_STD_PERSONCLASSPROVI;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCLASSPROVI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCLASSHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCLASSHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCLASSHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCLASSHISTO FOR SDSADM.RUPD$_STD_PERSONCLASSHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCLASSHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCLASSCLASS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCLASSCLASS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCLASSCLASS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCLASSCLASS FOR SDSADM.RUPD$_STD_PERSONCLASSCLASS;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCLASSCLASS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCLASSCHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCLASSCHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCLASSCHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCLASSCHIST FOR SDSADM.RUPD$_STD_PERSONCLASSCHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCLASSCHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCLASS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCLASS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCLASS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCLASS FOR SDSADM.RUPD$_STD_PERSONCLASS;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCLASS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCATEGORYHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCATEGORYHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCATEGORYHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCATEGORYHI FOR SDSADM.RUPD$_STD_PERSONCATEGORYHI;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCATEGORYHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERSONCATEGORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERSONCATEGORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERSONCATEGORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERSONCATEGORY FOR SDSADM.RUPD$_STD_PERSONCATEGORY;


GRANT SELECT ON SDSADM.RUPD$_STD_PERSONCATEGORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERMANENTCODEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERMANENTCODEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERMANENTCODEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERMANENTCODEHIS FOR SDSADM.RUPD$_STD_PERMANENTCODEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_PERMANENTCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERMANENTCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERMANENTCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERMANENTCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERMANENTCODE FOR SDSADM.RUPD$_STD_PERMANENTCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_PERMANENTCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERIODOFSERVICEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERIODOFSERVICEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERIODOFSERVICEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERIODOFSERVICEH FOR SDSADM.RUPD$_STD_PERIODOFSERVICEH;


GRANT SELECT ON SDSADM.RUPD$_STD_PERIODOFSERVICEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PERIODOFSERVICE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PERIODOFSERVICE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PERIODOFSERVICE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PERIODOFSERVICE FOR SDSADM.RUPD$_STD_PERIODOFSERVICE;


GRANT SELECT ON SDSADM.RUPD$_STD_PERIODOFSERVICE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PATIENTTYPEHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PATIENTTYPEHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PATIENTTYPEHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PATIENTTYPEHISTO FOR SDSADM.RUPD$_STD_PATIENTTYPEHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_PATIENTTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_PATIENTTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_PATIENTTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_PATIENTTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_PATIENTTYPE FOR SDSADM.RUPD$_STD_PATIENTTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_PATIENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_OTHERFEDERALAGEN1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_OTHERFEDERALAGEN1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_OTHERFEDERALAGEN1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_OTHERFEDERALAGEN1 FOR SDSADM.RUPD$_STD_OTHERFEDERALAGEN1;


GRANT SELECT ON SDSADM.RUPD$_STD_OTHERFEDERALAGEN1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_OTHERFEDERALAGEN CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_OTHERFEDERALAGEN
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_OTHERFEDERALAGEN IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_OTHERFEDERALAGEN FOR SDSADM.RUPD$_STD_OTHERFEDERALAGEN;


GRANT SELECT ON SDSADM.RUPD$_STD_OTHERFEDERALAGEN TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ORGPROVTAXONOMYH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ORGPROVTAXONOMYH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ORGPROVTAXONOMYH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ORGPROVTAXONOMYH FOR SDSADM.RUPD$_STD_ORGPROVTAXONOMYH;


GRANT SELECT ON SDSADM.RUPD$_STD_ORGPROVTAXONOMYH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ORGPROVTAXONOMY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ORGPROVTAXONOMY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ORGPROVTAXONOMY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ORGPROVTAXONOMY FOR SDSADM.RUPD$_STD_ORGPROVTAXONOMY;


GRANT SELECT ON SDSADM.RUPD$_STD_ORGPROVTAXONOMY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_OEFOIFSOURCEHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_OEFOIFSOURCEHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_OEFOIFSOURCEHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_OEFOIFSOURCEHIST FOR SDSADM.RUPD$_STD_OEFOIFSOURCEHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_OEFOIFSOURCEHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_OEFOIFSOURCE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_OEFOIFSOURCE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_OEFOIFSOURCE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_OEFOIFSOURCE FOR SDSADM.RUPD$_STD_OEFOIFSOURCE;


GRANT SELECT ON SDSADM.RUPD$_STD_OEFOIFSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NTRVERIFICATNMTH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NTRVERIFICATNMTH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NTRVERIFICATNMTH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NTRVERIFICATNMTH FOR SDSADM.RUPD$_STD_NTRVERIFICATNMTH;


GRANT SELECT ON SDSADM.RUPD$_STD_NTRVERIFICATNMTH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NTRVERIFICATIONM CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NTRVERIFICATIONM
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NTRVERIFICATIONM IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NTRVERIFICATIONM FOR SDSADM.RUPD$_STD_NTRVERIFICATIONM;


GRANT SELECT ON SDSADM.RUPD$_STD_NTRVERIFICATIONM TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NTRQUALIFIERHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NTRQUALIFIERHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NTRQUALIFIERHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NTRQUALIFIERHIST FOR SDSADM.RUPD$_STD_NTRQUALIFIERHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_NTRQUALIFIERHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NTRQUALIFIER CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NTRQUALIFIER
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NTRQUALIFIER IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NTRQUALIFIER FOR SDSADM.RUPD$_STD_NTRQUALIFIER;


GRANT SELECT ON SDSADM.RUPD$_STD_NTRQUALIFIER TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NPPESORGALTRSNHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NPPESORGALTRSNHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NPPESORGALTRSNHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NPPESORGALTRSNHI FOR SDSADM.RUPD$_STD_NPPESORGALTRSNHI;


GRANT SELECT ON SDSADM.RUPD$_STD_NPPESORGALTRSNHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NPPESORGALTRSN CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NPPESORGALTRSN
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NPPESORGALTRSN IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NPPESORGALTRSN FOR SDSADM.RUPD$_STD_NPPESORGALTRSN;


GRANT SELECT ON SDSADM.RUPD$_STD_NPPESORGALTRSN TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NPPESORGALTIDHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NPPESORGALTIDHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NPPESORGALTIDHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NPPESORGALTIDHIS FOR SDSADM.RUPD$_STD_NPPESORGALTIDHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_NPPESORGALTIDHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NPPESORGALTID CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NPPESORGALTID
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NPPESORGALTID IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NPPESORGALTID FOR SDSADM.RUPD$_STD_NPPESORGALTID;


GRANT SELECT ON SDSADM.RUPD$_STD_NPPESORGALTID TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NPPESORGALIASTYP1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NPPESORGALIASTYP1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NPPESORGALIASTYP1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NPPESORGALIASTYP1 FOR SDSADM.RUPD$_STD_NPPESORGALIASTYP1;


GRANT SELECT ON SDSADM.RUPD$_STD_NPPESORGALIASTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NPPESORGALIASTYP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NPPESORGALIASTYP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NPPESORGALIASTYP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NPPESORGALIASTYP FOR SDSADM.RUPD$_STD_NPPESORGALIASTYP;


GRANT SELECT ON SDSADM.RUPD$_STD_NPPESORGALIASTYP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NOSITEUPLOADREAS1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NOSITEUPLOADREAS1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NOSITEUPLOADREAS1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NOSITEUPLOADREAS1 FOR SDSADM.RUPD$_STD_NOSITEUPLOADREAS1;


GRANT SELECT ON SDSADM.RUPD$_STD_NOSITEUPLOADREAS1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NOSITEUPLOADREAS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NOSITEUPLOADREAS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NOSITEUPLOADREAS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NOSITEUPLOADREAS FOR SDSADM.RUPD$_STD_NOSITEUPLOADREAS;


GRANT SELECT ON SDSADM.RUPD$_STD_NOSITEUPLOADREAS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NAMETYPEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NAMETYPEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NAMETYPEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NAMETYPEHISTORY FOR SDSADM.RUPD$_STD_NAMETYPEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_NAMETYPEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NAMETYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NAMETYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NAMETYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NAMETYPE FOR SDSADM.RUPD$_STD_NAMETYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_NAMETYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NAMEDCONTINGENCY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NAMEDCONTINGENCY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NAMEDCONTINGENCY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NAMEDCONTINGENCY1 FOR SDSADM.RUPD$_STD_NAMEDCONTINGENCY1;


GRANT SELECT ON SDSADM.RUPD$_STD_NAMEDCONTINGENCY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_NAMEDCONTINGENCY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_NAMEDCONTINGENCY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_NAMEDCONTINGENCY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_NAMEDCONTINGENCY FOR SDSADM.RUPD$_STD_NAMEDCONTINGENCY;


GRANT SELECT ON SDSADM.RUPD$_STD_NAMEDCONTINGENCY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MTNOTREQRSNTYPEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MTNOTREQRSNTYPEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MTNOTREQRSNTYPEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MTNOTREQRSNTYPEH FOR SDSADM.RUPD$_STD_MTNOTREQRSNTYPEH;


GRANT SELECT ON SDSADM.RUPD$_STD_MTNOTREQRSNTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MTNOTREQRSNTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MTNOTREQRSNTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MTNOTREQRSNTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MTNOTREQRSNTYPE FOR SDSADM.RUPD$_STD_MTNOTREQRSNTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_MTNOTREQRSNTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MSTSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MSTSTATUSHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MSTSTATUSHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MSTSTATUSHISTORY FOR SDSADM.RUPD$_STD_MSTSTATUSHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_MSTSTATUSHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MSTSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MSTSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MSTSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MSTSTATUS FOR SDSADM.RUPD$_STD_MSTSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_MSTSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MSDSCOUNTRYHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MSDSCOUNTRYHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MSDSCOUNTRYHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MSDSCOUNTRYHISTO FOR SDSADM.RUPD$_STD_MSDSCOUNTRYHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_MSDSCOUNTRYHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MSDSCOUNTRY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MSDSCOUNTRY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MSDSCOUNTRY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MSDSCOUNTRY FOR SDSADM.RUPD$_STD_MSDSCOUNTRY;


GRANT SELECT ON SDSADM.RUPD$_STD_MSDSCOUNTRY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MONETARYBENEFITT1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MONETARYBENEFITT1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MONETARYBENEFITT1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MONETARYBENEFITT1 FOR SDSADM.RUPD$_STD_MONETARYBENEFITT1;


GRANT SELECT ON SDSADM.RUPD$_STD_MONETARYBENEFITT1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MONETARYBENEFITT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MONETARYBENEFITT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MONETARYBENEFITT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MONETARYBENEFITT FOR SDSADM.RUPD$_STD_MONETARYBENEFITT;


GRANT SELECT ON SDSADM.RUPD$_STD_MONETARYBENEFITT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MILITARYSVCQRYST1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MILITARYSVCQRYST1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MILITARYSVCQRYST1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MILITARYSVCQRYST1 FOR SDSADM.RUPD$_STD_MILITARYSVCQRYST1;


GRANT SELECT ON SDSADM.RUPD$_STD_MILITARYSVCQRYST1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MILITARYSVCQRYST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MILITARYSVCQRYST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MILITARYSVCQRYST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MILITARYSVCQRYST FOR SDSADM.RUPD$_STD_MILITARYSVCQRYST;


GRANT SELECT ON SDSADM.RUPD$_STD_MILITARYSVCQRYST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MILITARYSVCCOMPH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MILITARYSVCCOMPH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MILITARYSVCCOMPH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MILITARYSVCCOMPH FOR SDSADM.RUPD$_STD_MILITARYSVCCOMPH;


GRANT SELECT ON SDSADM.RUPD$_STD_MILITARYSVCCOMPH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MILITARYSVCCOMP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MILITARYSVCCOMP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MILITARYSVCCOMP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MILITARYSVCCOMP FOR SDSADM.RUPD$_STD_MILITARYSVCCOMP;


GRANT SELECT ON SDSADM.RUPD$_STD_MILITARYSVCCOMP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MILHISTORYTYPEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MILHISTORYTYPEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MILHISTORYTYPEHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MILHISTORYTYPEHI FOR SDSADM.RUPD$_STD_MILHISTORYTYPEHI;


GRANT SELECT ON SDSADM.RUPD$_STD_MILHISTORYTYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MILHISTORYTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MILHISTORYTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MILHISTORYTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MILHISTORYTYPE FOR SDSADM.RUPD$_STD_MILHISTORYTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_MILHISTORYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MHDATASOURCEHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MHDATASOURCEHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MHDATASOURCEHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MHDATASOURCEHIST FOR SDSADM.RUPD$_STD_MHDATASOURCEHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_MHDATASOURCEHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MHDATASOURCE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MHDATASOURCE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MHDATASOURCE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MHDATASOURCE FOR SDSADM.RUPD$_STD_MHDATASOURCE;


GRANT SELECT ON SDSADM.RUPD$_STD_MHDATASOURCE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MESSAGETYPEHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MESSAGETYPEHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MESSAGETYPEHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MESSAGETYPEHISTO FOR SDSADM.RUPD$_STD_MESSAGETYPEHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_MESSAGETYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MESSAGETYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MESSAGETYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MESSAGETYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MESSAGETYPE FOR SDSADM.RUPD$_STD_MESSAGETYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_MESSAGETYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MESSAGESTATUSHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MESSAGESTATUSHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MESSAGESTATUSHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MESSAGESTATUSHIS FOR SDSADM.RUPD$_STD_MESSAGESTATUSHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_MESSAGESTATUSHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MESSAGESTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MESSAGESTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MESSAGESTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MESSAGESTATUS FOR SDSADM.RUPD$_STD_MESSAGESTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_MESSAGESTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MEANSTESTSTATUSH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MEANSTESTSTATUSH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MEANSTESTSTATUSH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MEANSTESTSTATUSH FOR SDSADM.RUPD$_STD_MEANSTESTSTATUSH;


GRANT SELECT ON SDSADM.RUPD$_STD_MEANSTESTSTATUSH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MEANSTESTSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MEANSTESTSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MEANSTESTSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MEANSTESTSTATUS FOR SDSADM.RUPD$_STD_MEANSTESTSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_MEANSTESTSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MEANSTESTSIGSTAT1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MEANSTESTSIGSTAT1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MEANSTESTSIGSTAT1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MEANSTESTSIGSTAT1 FOR SDSADM.RUPD$_STD_MEANSTESTSIGSTAT1;


GRANT SELECT ON SDSADM.RUPD$_STD_MEANSTESTSIGSTAT1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MEANSTESTSIGSTAT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MEANSTESTSIGSTAT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MEANSTESTSIGSTAT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MEANSTESTSIGSTAT FOR SDSADM.RUPD$_STD_MEANSTESTSIGSTAT;


GRANT SELECT ON SDSADM.RUPD$_STD_MEANSTESTSIGSTAT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MASMTTHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MASMTTHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MASMTTHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MASMTTHISTORY FOR SDSADM.RUPD$_STD_MASMTTHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_MASMTTHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MASMOVEMENTTRANS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MASMOVEMENTTRANS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MASMOVEMENTTRANS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MASMOVEMENTTRANS FOR SDSADM.RUPD$_STD_MASMOVEMENTTRANS;


GRANT SELECT ON SDSADM.RUPD$_STD_MASMOVEMENTTRANS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MARITALSTATUSHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MARITALSTATUSHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MARITALSTATUSHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MARITALSTATUSHIS FOR SDSADM.RUPD$_STD_MARITALSTATUSHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_MARITALSTATUSHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_MARITALSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_MARITALSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_MARITALSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_MARITALSTATUS FOR SDSADM.RUPD$_STD_MARITALSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_MARITALSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_LOCATIONTYPEHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_LOCATIONTYPEHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_LOCATIONTYPEHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_LOCATIONTYPEHIST FOR SDSADM.RUPD$_STD_LOCATIONTYPEHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_LOCATIONTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_LOCATIONTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_LOCATIONTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_LOCATIONTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_LOCATIONTYPE FOR SDSADM.RUPD$_STD_LOCATIONTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_LOCATIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IVMUNITHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IVMUNITHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IVMUNITHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IVMUNITHISTORY FOR SDSADM.RUPD$_STD_IVMUNITHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_IVMUNITHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IVMUNIT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IVMUNIT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IVMUNIT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IVMUNIT FOR SDSADM.RUPD$_STD_IVMUNIT;


GRANT SELECT ON SDSADM.RUPD$_STD_IVMUNIT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IVMMIGRATETYPEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IVMMIGRATETYPEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IVMMIGRATETYPEHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IVMMIGRATETYPEHI FOR SDSADM.RUPD$_STD_IVMMIGRATETYPEHI;


GRANT SELECT ON SDSADM.RUPD$_STD_IVMMIGRATETYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IVMMIGRATETYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IVMMIGRATETYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IVMMIGRATETYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IVMMIGRATETYPE FOR SDSADM.RUPD$_STD_IVMMIGRATETYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_IVMMIGRATETYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IVMDECISIONTYPEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IVMDECISIONTYPEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IVMDECISIONTYPEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IVMDECISIONTYPEH FOR SDSADM.RUPD$_STD_IVMDECISIONTYPEH;


GRANT SELECT ON SDSADM.RUPD$_STD_IVMDECISIONTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IVMDECISIONTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IVMDECISIONTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IVMDECISIONTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IVMDECISIONTYPE FOR SDSADM.RUPD$_STD_IVMDECISIONTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_IVMDECISIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IVMCASEPRIORCRIT1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IVMCASEPRIORCRIT1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IVMCASEPRIORCRIT1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IVMCASEPRIORCRIT1 FOR SDSADM.RUPD$_STD_IVMCASEPRIORCRIT1;


GRANT SELECT ON SDSADM.RUPD$_STD_IVMCASEPRIORCRIT1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IVMCASEPRIORCRIT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IVMCASEPRIORCRIT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IVMCASEPRIORCRIT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IVMCASEPRIORCRIT FOR SDSADM.RUPD$_STD_IVMCASEPRIORCRIT;


GRANT SELECT ON SDSADM.RUPD$_STD_IVMCASEPRIORCRIT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSURANCETYPEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSURANCETYPEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSURANCETYPEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSURANCETYPEHIS FOR SDSADM.RUPD$_STD_INSURANCETYPEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_INSURANCETYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSURANCETYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSURANCETYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSURANCETYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSURANCETYPE FOR SDSADM.RUPD$_STD_INSURANCETYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_INSURANCETYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSURANCEREPORTS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSURANCEREPORTS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSURANCEREPORTS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSURANCEREPORTS FOR SDSADM.RUPD$_STD_INSURANCEREPORTS;


GRANT SELECT ON SDSADM.RUPD$_STD_INSURANCEREPORTS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSURANCEPLANTYP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSURANCEPLANTYP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSURANCEPLANTYP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSURANCEPLANTYP FOR SDSADM.RUPD$_STD_INSURANCEPLANTYP;


GRANT SELECT ON SDSADM.RUPD$_STD_INSURANCEPLANTYP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSURANCEMAPPING1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSURANCEMAPPING1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSURANCEMAPPING1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSURANCEMAPPING1 FOR SDSADM.RUPD$_STD_INSURANCEMAPPING1;


GRANT SELECT ON SDSADM.RUPD$_STD_INSURANCEMAPPING1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSURANCEMAPPING CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSURANCEMAPPING
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSURANCEMAPPING IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSURANCEMAPPING FOR SDSADM.RUPD$_STD_INSURANCEMAPPING;


GRANT SELECT ON SDSADM.RUPD$_STD_INSURANCEMAPPING TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSURANCEHOLDERT1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSURANCEHOLDERT1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSURANCEHOLDERT1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSURANCEHOLDERT1 FOR SDSADM.RUPD$_STD_INSURANCEHOLDERT1;


GRANT SELECT ON SDSADM.RUPD$_STD_INSURANCEHOLDERT1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSURANCEHOLDERT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSURANCEHOLDERT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSURANCEHOLDERT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSURANCEHOLDERT FOR SDSADM.RUPD$_STD_INSURANCEHOLDERT;


GRANT SELECT ON SDSADM.RUPD$_STD_INSURANCEHOLDERT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSTITUTIONCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSTITUTIONCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSTITUTIONCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSTITUTIONCODE FOR SDSADM.RUPD$_STD_INSTITUTIONCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_INSTITUTIONCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSTITUTION CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSTITUTION
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSTITUTION IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSTITUTION FOR SDSADM.RUPD$_STD_INSTITUTION;


GRANT SELECT ON SDSADM.RUPD$_STD_INSTITUTION TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSRPRTSRCHISTOR CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSRPRTSRCHISTOR
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSRPRTSRCHISTOR IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSRPRTSRCHISTOR FOR SDSADM.RUPD$_STD_INSRPRTSRCHISTOR;


GRANT SELECT ON SDSADM.RUPD$_STD_INSRPRTSRCHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INSPLANTYPEHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INSPLANTYPEHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INSPLANTYPEHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INSPLANTYPEHISTO FOR SDSADM.RUPD$_STD_INSPLANTYPEHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_INSPLANTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMEVERIFSTATU1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMEVERIFSTATU1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMEVERIFSTATU1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMEVERIFSTATU1 FOR SDSADM.RUPD$_STD_INCOMEVERIFSTATU1;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMEVERIFSTATU1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMEVERIFSTATU CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMEVERIFSTATU
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMEVERIFSTATU IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMEVERIFSTATU FOR SDSADM.RUPD$_STD_INCOMEVERIFSTATU;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMEVERIFSTATU TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMETYPEHISTOR CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMETYPEHISTOR
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMETYPEHISTOR IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMETYPEHISTOR FOR SDSADM.RUPD$_STD_INCOMETYPEHISTOR;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMETYPEHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMETYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMETYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMETYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMETYPE FOR SDSADM.RUPD$_STD_INCOMETYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMETYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMETHRESHOLDH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMETHRESHOLDH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMETHRESHOLDH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMETHRESHOLDH FOR SDSADM.RUPD$_STD_INCOMETHRESHOLDH;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMETHRESHOLDH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMETHRESHOLD CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMETHRESHOLD
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMETHRESHOLD IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMETHRESHOLD FOR SDSADM.RUPD$_STD_INCOMETHRESHOLD;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMETHRESHOLD TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMETESTTYPEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMETESTTYPEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMETESTTYPEHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMETESTTYPEHI FOR SDSADM.RUPD$_STD_INCOMETESTTYPEHI;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMETESTTYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMETESTTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMETESTTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMETESTTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMETESTTYPE FOR SDSADM.RUPD$_STD_INCOMETESTTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMETESTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMETESTSOURCE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMETESTSOURCE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMETESTSOURCE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMETESTSOURCE1 FOR SDSADM.RUPD$_STD_INCOMETESTSOURCE1;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMETESTSOURCE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_INCOMETESTSOURCE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_INCOMETESTSOURCE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_INCOMETESTSOURCE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_INCOMETESTSOURCE FOR SDSADM.RUPD$_STD_INCOMETESTSOURCE;


GRANT SELECT ON SDSADM.RUPD$_STD_INCOMETESTSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDTASKSTATUSTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDTASKSTATUSTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDTASKSTATUSTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDTASKSTATUSTYPE1 FOR SDSADM.RUPD$_STD_IDTASKSTATUSTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_IDTASKSTATUSTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDTASKSTATUSTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDTASKSTATUSTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDTASKSTATUSTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDTASKSTATUSTYPE FOR SDSADM.RUPD$_STD_IDTASKSTATUSTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_IDTASKSTATUSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDTASKPROBCATEGO1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDTASKPROBCATEGO1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDTASKPROBCATEGO1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDTASKPROBCATEGO1 FOR SDSADM.RUPD$_STD_IDTASKPROBCATEGO1;


GRANT SELECT ON SDSADM.RUPD$_STD_IDTASKPROBCATEGO1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDTASKPROBCATEGO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDTASKPROBCATEGO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDTASKPROBCATEGO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDTASKPROBCATEGO FOR SDSADM.RUPD$_STD_IDTASKPROBCATEGO;


GRANT SELECT ON SDSADM.RUPD$_STD_IDTASKPROBCATEGO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDEXCEPTYPEGROUP1 FOR SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP1;


GRANT SELECT ON SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDEXCEPTYPEGROUP FOR SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP;


GRANT SELECT ON SDSADM.RUPD$_STD_IDEXCEPTYPEGROUP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDEVENTTYPEHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDEVENTTYPEHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDEVENTTYPEHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDEVENTTYPEHISTO FOR SDSADM.RUPD$_STD_IDEVENTTYPEHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_IDEVENTTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDEVENTTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDEVENTTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDEVENTTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDEVENTTYPE FOR SDSADM.RUPD$_STD_IDEVENTTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_IDEVENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDENTIFIERTYPEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDENTIFIERTYPEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDENTIFIERTYPEHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDENTIFIERTYPEHI FOR SDSADM.RUPD$_STD_IDENTIFIERTYPEHI;


GRANT SELECT ON SDSADM.RUPD$_STD_IDENTIFIERTYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_IDENTIFIERTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_IDENTIFIERTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_IDENTIFIERTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_IDENTIFIERTYPE FOR SDSADM.RUPD$_STD_IDENTIFIERTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_IDENTIFIERTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7WHATSUBJECTFL1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7WHATSUBJECTFL1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7WHATSUBJECTFL1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7WHATSUBJECTFL1 FOR SDSADM.RUPD$_STD_HL7WHATSUBJECTFL1;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7WHATSUBJECTFL1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7WHATSUBJECTFL CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7WHATSUBJECTFL
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7WHATSUBJECTFL IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7WHATSUBJECTFL FOR SDSADM.RUPD$_STD_HL7WHATSUBJECTFL;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7WHATSUBJECTFL TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7VERSIONIDHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7VERSIONIDHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7VERSIONIDHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7VERSIONIDHIST FOR SDSADM.RUPD$_STD_HL7VERSIONIDHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7VERSIONIDHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7VERSIONID CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7VERSIONID
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7VERSIONID IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7VERSIONID FOR SDSADM.RUPD$_STD_HL7VERSIONID;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7VERSIONID TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7VALUETYPEHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7VALUETYPEHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7VALUETYPEHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7VALUETYPEHIST FOR SDSADM.RUPD$_STD_HL7VALUETYPEHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7VALUETYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7VALUETYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7VALUETYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7VALUETYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7VALUETYPE FOR SDSADM.RUPD$_STD_HL7VALUETYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7VALUETYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7SRCOFCOMMENTH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7SRCOFCOMMENTH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7SRCOFCOMMENTH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7SRCOFCOMMENTH FOR SDSADM.RUPD$_STD_HL7SRCOFCOMMENTH;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7SRCOFCOMMENTH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7SRCOFCOMMENT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7SRCOFCOMMENT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7SRCOFCOMMENT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7SRCOFCOMMENT FOR SDSADM.RUPD$_STD_HL7SRCOFCOMMENT;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7SRCOFCOMMENT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7RESPMODALITYH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7RESPMODALITYH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7RESPMODALITYH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7RESPMODALITYH FOR SDSADM.RUPD$_STD_HL7RESPMODALITYH;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7RESPMODALITYH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7RESPMODALITY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7RESPMODALITY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7RESPMODALITY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7RESPMODALITY FOR SDSADM.RUPD$_STD_HL7RESPMODALITY;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7RESPMODALITY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7RESPLEVCODEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7RESPLEVCODEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7RESPLEVCODEHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7RESPLEVCODEHI FOR SDSADM.RUPD$_STD_HL7RESPLEVCODEHI;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7RESPLEVCODEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7RESPLEVCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7RESPLEVCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7RESPLEVCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7RESPLEVCODE FOR SDSADM.RUPD$_STD_HL7RESPLEVCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7RESPLEVCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7RECLEVEVCODEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7RECLEVEVCODEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7RECLEVEVCODEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7RECLEVEVCODEH FOR SDSADM.RUPD$_STD_HL7RECLEVEVCODEH;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7RECLEVEVCODEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7RECLEVEVCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7RECLEVEVCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7RECLEVEVCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7RECLEVEVCODE FOR SDSADM.RUPD$_STD_HL7RECLEVEVCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7RECLEVEVCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7RECLEVERRRETH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7RECLEVERRRETH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7RECLEVERRRETH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7RECLEVERRRETH FOR SDSADM.RUPD$_STD_HL7RECLEVERRRETH;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7RECLEVERRRETH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7RECLEVERRRET CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7RECLEVERRRET
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7RECLEVERRRET IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7RECLEVERRRET FOR SDSADM.RUPD$_STD_HL7RECLEVERRRET;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7RECLEVERRRET TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QUERYRESULTSH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QUERYRESULTSH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QUERYRESULTSH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QUERYRESULTSH FOR SDSADM.RUPD$_STD_HL7QUERYRESULTSH;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QUERYRESULTSH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QUERYRESULTS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QUERYRESULTS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QUERYRESULTS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QUERYRESULTS FOR SDSADM.RUPD$_STD_HL7QUERYRESULTS;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QUERYRESULTS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QUERYRESPONSE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QUERYRESPONSE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QUERYRESPONSE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QUERYRESPONSE FOR SDSADM.RUPD$_STD_HL7QUERYRESPONSE;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QUERYRESPONSE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QUERYPRIORITY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QUERYPRIORITY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QUERYPRIORITY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QUERYPRIORITY1 FOR SDSADM.RUPD$_STD_HL7QUERYPRIORITY1;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QUERYPRIORITY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QUERYPRIORITY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QUERYPRIORITY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QUERYPRIORITY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QUERYPRIORITY FOR SDSADM.RUPD$_STD_HL7QUERYPRIORITY;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QUERYPRIORITY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QUANTITYLIMIT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QUANTITYLIMIT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QUANTITYLIMIT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QUANTITYLIMIT FOR SDSADM.RUPD$_STD_HL7QUANTITYLIMIT;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QUANTITYLIMIT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QUANLIMREQHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QUANLIMREQHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QUANLIMREQHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QUANLIMREQHIS FOR SDSADM.RUPD$_STD_HL7QUANLIMREQHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QUANLIMREQHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QRYRESPSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QRYRESPSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QRYRESPSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QRYRESPSTATUS FOR SDSADM.RUPD$_STD_HL7QRYRESPSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QRYRESPSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QRYRESPFMTCOD1 FOR SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD1;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7QRYRESPFMTCOD FOR SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7QRYRESPFMTCOD TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7PROCMODEHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7PROCMODEHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7PROCMODEHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7PROCMODEHISTO FOR SDSADM.RUPD$_STD_HL7PROCMODEHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7PROCMODEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7PROCIDHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7PROCIDHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7PROCIDHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7PROCIDHISTORY FOR SDSADM.RUPD$_STD_HL7PROCIDHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7PROCIDHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7PROCESSINGMOD CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7PROCESSINGMOD
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7PROCESSINGMOD IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7PROCESSINGMOD FOR SDSADM.RUPD$_STD_HL7PROCESSINGMOD;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7PROCESSINGMOD TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7PROCESSINGID CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7PROCESSINGID
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7PROCESSINGID IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7PROCESSINGID FOR SDSADM.RUPD$_STD_HL7PROCESSINGID;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7PROCESSINGID TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7PRIMKEYVALTYP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7PRIMKEYVALTYP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7PRIMKEYVALTYP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7PRIMKEYVALTYP FOR SDSADM.RUPD$_STD_HL7PRIMKEYVALTYP;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7PRIMKEYVALTYP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7PRIMARYKEYVAL CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7PRIMARYKEYVAL
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7PRIMARYKEYVAL IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7PRIMARYKEYVAL FOR SDSADM.RUPD$_STD_HL7PRIMARYKEYVAL;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7PRIMARYKEYVAL TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7OBSERVRESULTC1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7OBSERVRESULTC1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7OBSERVRESULTC1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7OBSERVRESULTC1 FOR SDSADM.RUPD$_STD_HL7OBSERVRESULTC1;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7OBSERVRESULTC1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7OBSERVRESULTC CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7OBSERVRESULTC
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7OBSERVRESULTC IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7OBSERVRESULTC FOR SDSADM.RUPD$_STD_HL7OBSERVRESULTC;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7OBSERVRESULTC TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7MESSAGETYPEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7MESSAGETYPEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7MESSAGETYPEHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7MESSAGETYPEHI FOR SDSADM.RUPD$_STD_HL7MESSAGETYPEHI;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7MESSAGETYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7MESSAGETYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7MESSAGETYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7MESSAGETYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7MESSAGETYPE FOR SDSADM.RUPD$_STD_HL7MESSAGETYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7MESSAGETYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7MESSAGESTRUCH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7MESSAGESTRUCH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7MESSAGESTRUCH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7MESSAGESTRUCH FOR SDSADM.RUPD$_STD_HL7MESSAGESTRUCH;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7MESSAGESTRUCH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7MESSAGESTRUC CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7MESSAGESTRUC
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7MESSAGESTRUC IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7MESSAGESTRUC FOR SDSADM.RUPD$_STD_HL7MESSAGESTRUC;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7MESSAGESTRUC TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7MASTERFILEIDC1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7MASTERFILEIDC1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7MASTERFILEIDC1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7MASTERFILEIDC1 FOR SDSADM.RUPD$_STD_HL7MASTERFILEIDC1;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7MASTERFILEIDC1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7MASTERFILEIDC CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7MASTERFILEIDC
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7MASTERFILEIDC IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7MASTERFILEIDC FOR SDSADM.RUPD$_STD_HL7MASTERFILEIDC;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7MASTERFILEIDC TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7FILELEVELEVEN1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7FILELEVELEVEN1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7FILELEVELEVEN1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7FILELEVELEVEN1 FOR SDSADM.RUPD$_STD_HL7FILELEVELEVEN1;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7FILELEVELEVEN1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7FILELEVELEVEN CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7FILELEVELEVEN
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7FILELEVELEVEN IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7FILELEVELEVEN FOR SDSADM.RUPD$_STD_HL7FILELEVELEVEN;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7FILELEVELEVEN TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7EVENTTYPEHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7EVENTTYPEHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7EVENTTYPEHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7EVENTTYPEHIST FOR SDSADM.RUPD$_STD_HL7EVENTTYPEHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7EVENTTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7EVENTTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7EVENTTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7EVENTTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7EVENTTYPE FOR SDSADM.RUPD$_STD_HL7EVENTTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7EVENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7DATATYPEHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7DATATYPEHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7DATATYPEHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7DATATYPEHISTO FOR SDSADM.RUPD$_STD_HL7DATATYPEHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7DATATYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7DATATYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7DATATYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7DATATYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7DATATYPE FOR SDSADM.RUPD$_STD_HL7DATATYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7DATATYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7ACTIONCODEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7ACTIONCODEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7ACTIONCODEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7ACTIONCODEHIS FOR SDSADM.RUPD$_STD_HL7ACTIONCODEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7ACTIONCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7ACTIONCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7ACTIONCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7ACTIONCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7ACTIONCODE FOR SDSADM.RUPD$_STD_HL7ACTIONCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7ACTIONCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7ACKTYPEHISTOR CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7ACKTYPEHISTOR
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7ACKTYPEHISTOR IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7ACKTYPEHISTOR FOR SDSADM.RUPD$_STD_HL7ACKTYPEHISTOR;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7ACKTYPEHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7ACKNOWLEDGEME1 FOR SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME1;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7ACKNOWLEDGEME FOR SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7ACKNOWLEDGEME TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL7ACKCODEHISTOR CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL7ACKCODEHISTOR
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL7ACKCODEHISTOR IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL7ACKCODEHISTOR FOR SDSADM.RUPD$_STD_HL7ACKCODEHISTOR;


GRANT SELECT ON SDSADM.RUPD$_STD_HL7ACKCODEHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL724RACEMAPHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL724RACEMAPHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL724RACEMAPHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL724RACEMAPHIST FOR SDSADM.RUPD$_STD_HL724RACEMAPHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_HL724RACEMAPHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL724RACEMAP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL724RACEMAP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL724RACEMAP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL724RACEMAP FOR SDSADM.RUPD$_STD_HL724RACEMAP;


GRANT SELECT ON SDSADM.RUPD$_STD_HL724RACEMAP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL724MARITALSTAM1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL724MARITALSTAM1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL724MARITALSTAM1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL724MARITALSTAM1 FOR SDSADM.RUPD$_STD_HL724MARITALSTAM1;


GRANT SELECT ON SDSADM.RUPD$_STD_HL724MARITALSTAM1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL724MARITALSTAM CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL724MARITALSTAM
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL724MARITALSTAM IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL724MARITALSTAM FOR SDSADM.RUPD$_STD_HL724MARITALSTAM;


GRANT SELECT ON SDSADM.RUPD$_STD_HL724MARITALSTAM TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL724ETHNICITYMA1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL724ETHNICITYMA1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL724ETHNICITYMA1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL724ETHNICITYMA1 FOR SDSADM.RUPD$_STD_HL724ETHNICITYMA1;


GRANT SELECT ON SDSADM.RUPD$_STD_HL724ETHNICITYMA1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HL724ETHNICITYMA CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HL724ETHNICITYMA
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HL724ETHNICITYMA IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HL724ETHNICITYMA FOR SDSADM.RUPD$_STD_HL724ETHNICITYMA;


GRANT SELECT ON SDSADM.RUPD$_STD_HL724ETHNICITYMA TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HEALTHBENEFITTYP1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HEALTHBENEFITTYP1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HEALTHBENEFITTYP1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HEALTHBENEFITTYP1 FOR SDSADM.RUPD$_STD_HEALTHBENEFITTYP1;


GRANT SELECT ON SDSADM.RUPD$_STD_HEALTHBENEFITTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HEALTHBENEFITTYP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HEALTHBENEFITTYP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HEALTHBENEFITTYP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HEALTHBENEFITTYP FOR SDSADM.RUPD$_STD_HEALTHBENEFITTYP;


GRANT SELECT ON SDSADM.RUPD$_STD_HEALTHBENEFITTYP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HEALTHBENEFITPLA1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HEALTHBENEFITPLA1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HEALTHBENEFITPLA1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HEALTHBENEFITPLA1 FOR SDSADM.RUPD$_STD_HEALTHBENEFITPLA1;


GRANT SELECT ON SDSADM.RUPD$_STD_HEALTHBENEFITPLA1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_HEALTHBENEFITPLA CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_HEALTHBENEFITPLA
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_HEALTHBENEFITPLA IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_HEALTHBENEFITPLA FOR SDSADM.RUPD$_STD_HEALTHBENEFITPLA;


GRANT SELECT ON SDSADM.RUPD$_STD_HEALTHBENEFITPLA TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_GMTTHRESHOLDS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_GMTTHRESHOLDS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_GMTTHRESHOLDS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_GMTTHRESHOLDS FOR SDSADM.RUPD$_STD_GMTTHRESHOLDS;


GRANT SELECT ON SDSADM.RUPD$_STD_GMTTHRESHOLDS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_GENDERHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_GENDERHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_GENDERHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_GENDERHISTORY FOR SDSADM.RUPD$_STD_GENDERHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_GENDERHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_GENDER CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_GENDER
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_GENDER IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_GENDER FOR SDSADM.RUPD$_STD_GENDER;


GRANT SELECT ON SDSADM.RUPD$_STD_GENDER TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FTITRANSTYPEHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FTITRANSTYPEHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FTITRANSTYPEHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FTITRANSTYPEHIST FOR SDSADM.RUPD$_STD_FTITRANSTYPEHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_FTITRANSTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FTITRANSTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FTITRANSTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FTITRANSTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FTITRANSTYPE FOR SDSADM.RUPD$_STD_FTITRANSTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_FTITRANSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FTITRANSSTATUSHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FTITRANSSTATUSHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FTITRANSSTATUSHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FTITRANSSTATUSHI FOR SDSADM.RUPD$_STD_FTITRANSSTATUSHI;


GRANT SELECT ON SDSADM.RUPD$_STD_FTITRANSSTATUSHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FTITRANSSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FTITRANSSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FTITRANSSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FTITRANSSTATUS FOR SDSADM.RUPD$_STD_FTITRANSSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_FTITRANSSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FINANINFOSOURCEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FINANINFOSOURCEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FINANINFOSOURCEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FINANINFOSOURCEH FOR SDSADM.RUPD$_STD_FINANINFOSOURCEH;


GRANT SELECT ON SDSADM.RUPD$_STD_FINANINFOSOURCEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FINANINFOSOURCE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FINANINFOSOURCE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FINANINFOSOURCE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FINANINFOSOURCE FOR SDSADM.RUPD$_STD_FINANINFOSOURCE;


GRANT SELECT ON SDSADM.RUPD$_STD_FINANINFOSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FINANCIALMAPPING1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FINANCIALMAPPING1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FINANCIALMAPPING1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FINANCIALMAPPING1 FOR SDSADM.RUPD$_STD_FINANCIALMAPPING1;


GRANT SELECT ON SDSADM.RUPD$_STD_FINANCIALMAPPING1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FINANCIALMAPPING CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FINANCIALMAPPING
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FINANCIALMAPPING IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FINANCIALMAPPING FOR SDSADM.RUPD$_STD_FINANCIALMAPPING;


GRANT SELECT ON SDSADM.RUPD$_STD_FINANCIALMAPPING TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FINANCIALDOCUMTY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FINANCIALDOCUMTY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FINANCIALDOCUMTY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FINANCIALDOCUMTY1 FOR SDSADM.RUPD$_STD_FINANCIALDOCUMTY1;


GRANT SELECT ON SDSADM.RUPD$_STD_FINANCIALDOCUMTY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FINANCIALDOCUMTY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FINANCIALDOCUMTY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FINANCIALDOCUMTY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FINANCIALDOCUMTY FOR SDSADM.RUPD$_STD_FINANCIALDOCUMTY;


GRANT SELECT ON SDSADM.RUPD$_STD_FINANCIALDOCUMTY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FILIPINOVETPROOF CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FILIPINOVETPROOF
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FILIPINOVETPROOF IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FILIPINOVETPROOF FOR SDSADM.RUPD$_STD_FILIPINOVETPROOF;


GRANT SELECT ON SDSADM.RUPD$_STD_FILIPINOVETPROOF TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FILIPINOVETERANP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FILIPINOVETERANP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FILIPINOVETERANP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FILIPINOVETERANP FOR SDSADM.RUPD$_STD_FILIPINOVETERANP;


GRANT SELECT ON SDSADM.RUPD$_STD_FILIPINOVETERANP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FEEBASISTRTMNTHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FEEBASISTRTMNTHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FEEBASISTRTMNTHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FEEBASISTRTMNTHI FOR SDSADM.RUPD$_STD_FEEBASISTRTMNTHI;


GRANT SELECT ON SDSADM.RUPD$_STD_FEEBASISTRTMNTHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FEEBASISTREATMEN CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FEEBASISTREATMEN
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FEEBASISTREATMEN IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FEEBASISTREATMEN FOR SDSADM.RUPD$_STD_FEEBASISTREATMEN;


GRANT SELECT ON SDSADM.RUPD$_STD_FEEBASISTREATMEN TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FEEBASISPROGRAM CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FEEBASISPROGRAM
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FEEBASISPROGRAM IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FEEBASISPROGRAM FOR SDSADM.RUPD$_STD_FEEBASISPROGRAM;


GRANT SELECT ON SDSADM.RUPD$_STD_FEEBASISPROGRAM TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FEEBASISPRGRMHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FEEBASISPRGRMHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FEEBASISPRGRMHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FEEBASISPRGRMHIS FOR SDSADM.RUPD$_STD_FEEBASISPRGRMHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_FEEBASISPRGRMHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FACILITYTYPEHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FACILITYTYPEHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FACILITYTYPEHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FACILITYTYPEHIST FOR SDSADM.RUPD$_STD_FACILITYTYPEHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_FACILITYTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_FACILITYTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_FACILITYTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_FACILITYTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_FACILITYTYPE FOR SDSADM.RUPD$_STD_FACILITYTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_FACILITYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EXTREMITYCODEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EXTREMITYCODEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EXTREMITYCODEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EXTREMITYCODEHIS FOR SDSADM.RUPD$_STD_EXTREMITYCODEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_EXTREMITYCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EXTREMITYCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EXTREMITYCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EXTREMITYCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EXTREMITYCODE FOR SDSADM.RUPD$_STD_EXTREMITYCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_EXTREMITYCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EXPENSETYPEHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EXPENSETYPEHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EXPENSETYPEHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EXPENSETYPEHISTO FOR SDSADM.RUPD$_STD_EXPENSETYPEHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_EXPENSETYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EXPENSETYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EXPENSETYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EXPENSETYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EXPENSETYPE FOR SDSADM.RUPD$_STD_EXPENSETYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_EXPENSETYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EXCLUSIONRSNTYPE1 FOR SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EXCLUSIONRSNTYPE FOR SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_EXCLUSIONRSNTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EVALUATIONMETHOD1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EVALUATIONMETHOD1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EVALUATIONMETHOD1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EVALUATIONMETHOD1 FOR SDSADM.RUPD$_STD_EVALUATIONMETHOD1;


GRANT SELECT ON SDSADM.RUPD$_STD_EVALUATIONMETHOD1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EVALUATIONMETHOD CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EVALUATIONMETHOD
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EVALUATIONMETHOD IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EVALUATIONMETHOD FOR SDSADM.RUPD$_STD_EVALUATIONMETHOD;


GRANT SELECT ON SDSADM.RUPD$_STD_EVALUATIONMETHOD TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ETHNICITYHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ETHNICITYHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ETHNICITYHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ETHNICITYHISTORY FOR SDSADM.RUPD$_STD_ETHNICITYHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_ETHNICITYHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ETHNICITYCOLLECT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ETHNICITYCOLLECT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ETHNICITYCOLLECT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ETHNICITYCOLLECT FOR SDSADM.RUPD$_STD_ETHNICITYCOLLECT;


GRANT SELECT ON SDSADM.RUPD$_STD_ETHNICITYCOLLECT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ETHNICITY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ETHNICITY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ETHNICITY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ETHNICITY FOR SDSADM.RUPD$_STD_ETHNICITY;


GRANT SELECT ON SDSADM.RUPD$_STD_ETHNICITY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ETHCOLLMTHDHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ETHCOLLMTHDHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ETHCOLLMTHDHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ETHCOLLMTHDHISTO FOR SDSADM.RUPD$_STD_ETHCOLLMTHDHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_ETHCOLLMTHDHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENTITLEMENTCODEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENTITLEMENTCODEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENTITLEMENTCODEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENTITLEMENTCODEH FOR SDSADM.RUPD$_STD_ENTITLEMENTCODEH;


GRANT SELECT ON SDSADM.RUPD$_STD_ENTITLEMENTCODEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENTITLEMENTCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENTITLEMENTCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENTITLEMENTCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENTITLEMENTCODE FOR SDSADM.RUPD$_STD_ENTITLEMENTCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_ENTITLEMENTCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTSTATUS1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTSTATUS1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTSTATUS1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTSTATUS1 FOR SDSADM.RUPD$_STD_ENROLLMENTSTATUS1;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTSTATUS FOR SDSADM.RUPD$_STD_ENROLLMENTSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTSOURCE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTSOURCE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTSOURCE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTSOURCE1 FOR SDSADM.RUPD$_STD_ENROLLMENTSOURCE1;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTSOURCE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTSOURCE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTSOURCE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTSOURCE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTSOURCE FOR SDSADM.RUPD$_STD_ENROLLMENTSOURCE;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORS1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORS1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORS1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTPRIORS1 FOR SDSADM.RUPD$_STD_ENROLLMENTPRIORS1;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTPRIORS1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTPRIORS FOR SDSADM.RUPD$_STD_ENROLLMENTPRIORS;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTPRIORS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORG1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORG1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORG1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTPRIORG1 FOR SDSADM.RUPD$_STD_ENROLLMENTPRIORG1;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTPRIORG1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORG CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORG
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTPRIORG IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTPRIORG FOR SDSADM.RUPD$_STD_ENROLLMENTPRIORG;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTPRIORG TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTOVRDER CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTOVRDER
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTOVRDER IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTOVRDER FOR SDSADM.RUPD$_STD_ENROLLMENTOVRDER;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTOVRDER TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTOVERRI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTOVERRI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTOVERRI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTOVERRI FOR SDSADM.RUPD$_STD_ENROLLMENTOVERRI;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTOVERRI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTCATTYP1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTCATTYP1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTCATTYP1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTCATTYP1 FOR SDSADM.RUPD$_STD_ENROLLMENTCATTYP1;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTCATTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ENROLLMENTCATTYP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ENROLLMENTCATTYP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ENROLLMENTCATTYP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ENROLLMENTCATTYP FOR SDSADM.RUPD$_STD_ENROLLMENTCATTYP;


GRANT SELECT ON SDSADM.RUPD$_STD_ENROLLMENTCATTYP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMPLOYMENTSTATUS1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMPLOYMENTSTATUS1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMPLOYMENTSTATUS1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMPLOYMENTSTATUS1 FOR SDSADM.RUPD$_STD_EMPLOYMENTSTATUS1;


GRANT SELECT ON SDSADM.RUPD$_STD_EMPLOYMENTSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMPLOYMENTSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMPLOYMENTSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMPLOYMENTSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMPLOYMENTSTATUS FOR SDSADM.RUPD$_STD_EMPLOYMENTSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_EMPLOYMENTSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMERGENCYRESPONS1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMERGENCYRESPONS1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMERGENCYRESPONS1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMERGENCYRESPONS1 FOR SDSADM.RUPD$_STD_EMERGENCYRESPONS1;


GRANT SELECT ON SDSADM.RUPD$_STD_EMERGENCYRESPONS1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMERGENCYRESPONS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMERGENCYRESPONS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMERGENCYRESPONS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMERGENCYRESPONS FOR SDSADM.RUPD$_STD_EMERGENCYRESPONS;


GRANT SELECT ON SDSADM.RUPD$_STD_EMERGENCYRESPONS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMAIL_DOMAINHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMAIL_DOMAINHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMAIL_DOMAINHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMAIL_DOMAINHIST FOR SDSADM.RUPD$_STD_EMAIL_DOMAINHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_EMAIL_DOMAINHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMAIL_DOMAIN CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMAIL_DOMAIN
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMAIL_DOMAIN IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMAIL_DOMAIN FOR SDSADM.RUPD$_STD_EMAIL_DOMAIN;


GRANT SELECT ON SDSADM.RUPD$_STD_EMAIL_DOMAIN TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMAILCHANGESOURC1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMAILCHANGESOURC1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMAILCHANGESOURC1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMAILCHANGESOURC1 FOR SDSADM.RUPD$_STD_EMAILCHANGESOURC1;


GRANT SELECT ON SDSADM.RUPD$_STD_EMAILCHANGESOURC1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMAILCHANGESOURC CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMAILCHANGESOURC
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMAILCHANGESOURC IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMAILCHANGESOURC FOR SDSADM.RUPD$_STD_EMAILCHANGESOURC;


GRANT SELECT ON SDSADM.RUPD$_STD_EMAILCHANGESOURC TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMAILADDRESSTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMAILADDRESSTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMAILADDRESSTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMAILADDRESSTYPE1 FOR SDSADM.RUPD$_STD_EMAILADDRESSTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_EMAILADDRESSTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EMAILADDRESSTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EMAILADDRESSTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EMAILADDRESSTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EMAILADDRESSTYPE FOR SDSADM.RUPD$_STD_EMAILADDRESSTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_EMAILADDRESSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGPRMRYDATASRC CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGPRMRYDATASRC
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGPRMRYDATASRC IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGPRMRYDATASRC FOR SDSADM.RUPD$_STD_ELIGPRMRYDATASRC;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGPRMRYDATASRC TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYVRSCT1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYVRSCT1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYVRSCT1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYVRSCT1 FOR SDSADM.RUPD$_STD_ELIGIBILITYVRSCT1;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYVRSCT1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYVRSCT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYVRSCT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYVRSCT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYVRSCT FOR SDSADM.RUPD$_STD_ELIGIBILITYVRSCT;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYVRSCT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYSTATU1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYSTATU1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYSTATU1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYSTATU1 FOR SDSADM.RUPD$_STD_ELIGIBILITYSTATU1;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYSTATU1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYSTATU CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYSTATU
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYSTATU IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYSTATU FOR SDSADM.RUPD$_STD_ELIGIBILITYSTATU;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYSTATU TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYPRIMA CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYPRIMA
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYPRIMA IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYPRIMA FOR SDSADM.RUPD$_STD_ELIGIBILITYPRIMA;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYPRIMA TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYFACTO1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYFACTO1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYFACTO1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYFACTO1 FOR SDSADM.RUPD$_STD_ELIGIBILITYFACTO1;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYFACTO1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYFACTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYFACTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYFACTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYFACTO FOR SDSADM.RUPD$_STD_ELIGIBILITYFACTO;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYFACTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODET1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODET1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODET1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYCODET1 FOR SDSADM.RUPD$_STD_ELIGIBILITYCODET1;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYCODET1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODET CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODET
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODET IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYCODET FOR SDSADM.RUPD$_STD_ELIGIBILITYCODET;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYCODET TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYCODEH FOR SDSADM.RUPD$_STD_ELIGIBILITYCODEH;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYCODEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGIBILITYCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGIBILITYCODE FOR SDSADM.RUPD$_STD_ELIGIBILITYCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGIBILITYCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGDOCTYPEHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGDOCTYPEHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGDOCTYPEHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGDOCTYPEHISTO FOR SDSADM.RUPD$_STD_ELIGDOCTYPEHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGDOCTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELIGDOCTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELIGDOCTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELIGDOCTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELIGDOCTYPE FOR SDSADM.RUPD$_STD_ELIGDOCTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_ELIGDOCTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELECTRONICPLANTY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELECTRONICPLANTY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELECTRONICPLANTY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELECTRONICPLANTY1 FOR SDSADM.RUPD$_STD_ELECTRONICPLANTY1;


GRANT SELECT ON SDSADM.RUPD$_STD_ELECTRONICPLANTY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ELECTRONICPLANTY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ELECTRONICPLANTY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ELECTRONICPLANTY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ELECTRONICPLANTY FOR SDSADM.RUPD$_STD_ELECTRONICPLANTY;


GRANT SELECT ON SDSADM.RUPD$_STD_ELECTRONICPLANTY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EGTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EGTTYPEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EGTTYPEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EGTTYPEHISTORY FOR SDSADM.RUPD$_STD_EGTTYPEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_EGTTYPEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EGTTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EGTTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EGTTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EGTTYPE FOR SDSADM.RUPD$_STD_EGTTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_EGTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EGTPROCESSSTATUS1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EGTPROCESSSTATUS1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EGTPROCESSSTATUS1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EGTPROCESSSTATUS1 FOR SDSADM.RUPD$_STD_EGTPROCESSSTATUS1;


GRANT SELECT ON SDSADM.RUPD$_STD_EGTPROCESSSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_EGTPROCESSSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_EGTPROCESSSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_EGTPROCESSSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_EGTPROCESSSTATUS FOR SDSADM.RUPD$_STD_EGTPROCESSSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_EGTPROCESSSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DOCUMENTSOURCETY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DOCUMENTSOURCETY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DOCUMENTSOURCETY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DOCUMENTSOURCETY1 FOR SDSADM.RUPD$_STD_DOCUMENTSOURCETY1;


GRANT SELECT ON SDSADM.RUPD$_STD_DOCUMENTSOURCETY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DOCUMENTSOURCETY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DOCUMENTSOURCETY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DOCUMENTSOURCETY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DOCUMENTSOURCETY FOR SDSADM.RUPD$_STD_DOCUMENTSOURCETY;


GRANT SELECT ON SDSADM.RUPD$_STD_DOCUMENTSOURCETY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DISTRIBUTIONTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DISTRIBUTIONTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DISTRIBUTIONTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DISTRIBUTIONTYPE1 FOR SDSADM.RUPD$_STD_DISTRIBUTIONTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_DISTRIBUTIONTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DISTRIBUTIONTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DISTRIBUTIONTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DISTRIBUTIONTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DISTRIBUTIONTYPE FOR SDSADM.RUPD$_STD_DISTRIBUTIONTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_DISTRIBUTIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DISTRIBUTIONCODE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DISTRIBUTIONCODE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DISTRIBUTIONCODE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DISTRIBUTIONCODE1 FOR SDSADM.RUPD$_STD_DISTRIBUTIONCODE1;


GRANT SELECT ON SDSADM.RUPD$_STD_DISTRIBUTIONCODE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DISTRIBUTIONCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DISTRIBUTIONCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DISTRIBUTIONCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DISTRIBUTIONCODE FOR SDSADM.RUPD$_STD_DISTRIBUTIONCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_DISTRIBUTIONCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DISABILITYCONDIT1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DISABILITYCONDIT1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DISABILITYCONDIT1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DISABILITYCONDIT1 FOR SDSADM.RUPD$_STD_DISABILITYCONDIT1;


GRANT SELECT ON SDSADM.RUPD$_STD_DISABILITYCONDIT1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DISABILITYCONDIT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DISABILITYCONDIT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DISABILITYCONDIT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DISABILITYCONDIT FOR SDSADM.RUPD$_STD_DISABILITYCONDIT;


GRANT SELECT ON SDSADM.RUPD$_STD_DISABILITYCONDIT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DIAGNOSISTYPEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DIAGNOSISTYPEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DIAGNOSISTYPEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DIAGNOSISTYPEHIS FOR SDSADM.RUPD$_STD_DIAGNOSISTYPEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_DIAGNOSISTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DIAGNOSISTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DIAGNOSISTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DIAGNOSISTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DIAGNOSISTYPE FOR SDSADM.RUPD$_STD_DIAGNOSISTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_DIAGNOSISTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DIAGNOSISCODSCHH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DIAGNOSISCODSCHH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DIAGNOSISCODSCHH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DIAGNOSISCODSCHH FOR SDSADM.RUPD$_STD_DIAGNOSISCODSCHH;


GRANT SELECT ON SDSADM.RUPD$_STD_DIAGNOSISCODSCHH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DIAGNOSISCODSCH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DIAGNOSISCODSCH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DIAGNOSISCODSCH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DIAGNOSISCODSCH FOR SDSADM.RUPD$_STD_DIAGNOSISCODSCH;


GRANT SELECT ON SDSADM.RUPD$_STD_DIAGNOSISCODSCH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DIAGNOSISCODEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DIAGNOSISCODEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DIAGNOSISCODEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DIAGNOSISCODEHIS FOR SDSADM.RUPD$_STD_DIAGNOSISCODEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_DIAGNOSISCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DIAGNOSISCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DIAGNOSISCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DIAGNOSISCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DIAGNOSISCODE FOR SDSADM.RUPD$_STD_DIAGNOSISCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_DIAGNOSISCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DETAILEDINCOMETY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DETAILEDINCOMETY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DETAILEDINCOMETY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DETAILEDINCOMETY1 FOR SDSADM.RUPD$_STD_DETAILEDINCOMETY1;


GRANT SELECT ON SDSADM.RUPD$_STD_DETAILEDINCOMETY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DETAILEDINCOMETY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DETAILEDINCOMETY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DETAILEDINCOMETY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DETAILEDINCOMETY FOR SDSADM.RUPD$_STD_DETAILEDINCOMETY;


GRANT SELECT ON SDSADM.RUPD$_STD_DETAILEDINCOMETY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DETAILEDINCFINDO1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DETAILEDINCFINDO1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DETAILEDINCFINDO1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DETAILEDINCFINDO1 FOR SDSADM.RUPD$_STD_DETAILEDINCFINDO1;


GRANT SELECT ON SDSADM.RUPD$_STD_DETAILEDINCFINDO1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DETAILEDINCFINDO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DETAILEDINCFINDO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DETAILEDINCFINDO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DETAILEDINCFINDO FOR SDSADM.RUPD$_STD_DETAILEDINCFINDO;


GRANT SELECT ON SDSADM.RUPD$_STD_DETAILEDINCFINDO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DESCRIPTORCODEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DESCRIPTORCODEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DESCRIPTORCODEHI IS 'temporary updatable snapshot log';


GRANT SELECT ON SDSADM.RUPD$_STD_DESCRIPTORCODEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DESCRIPTORCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DESCRIPTORCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DESCRIPTORCODE IS 'temporary updatable snapshot log';


GRANT SELECT ON SDSADM.RUPD$_STD_DESCRIPTORCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DELIVERYSRCTYPEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DELIVERYSRCTYPEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DELIVERYSRCTYPEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DELIVERYSRCTYPEH FOR SDSADM.RUPD$_STD_DELIVERYSRCTYPEH;


GRANT SELECT ON SDSADM.RUPD$_STD_DELIVERYSRCTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DELIVERYSRCTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DELIVERYSRCTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DELIVERYSRCTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DELIVERYSRCTYPE FOR SDSADM.RUPD$_STD_DELIVERYSRCTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_DELIVERYSRCTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DELIVERYPREFTYPH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DELIVERYPREFTYPH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DELIVERYPREFTYPH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DELIVERYPREFTYPH FOR SDSADM.RUPD$_STD_DELIVERYPREFTYPH;


GRANT SELECT ON SDSADM.RUPD$_STD_DELIVERYPREFTYPH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DELIVERYPREFTYP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DELIVERYPREFTYP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DELIVERYPREFTYP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DELIVERYPREFTYP FOR SDSADM.RUPD$_STD_DELIVERYPREFTYP;


GRANT SELECT ON SDSADM.RUPD$_STD_DELIVERYPREFTYP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DEGREEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DEGREEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DEGREEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DEGREEHISTORY FOR SDSADM.RUPD$_STD_DEGREEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_DEGREEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DEGREE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DEGREE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DEGREE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DEGREE FOR SDSADM.RUPD$_STD_DEGREE;


GRANT SELECT ON SDSADM.RUPD$_STD_DEGREE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DECORATNDOCTYPHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DECORATNDOCTYPHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DECORATNDOCTYPHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DECORATNDOCTYPHI FOR SDSADM.RUPD$_STD_DECORATNDOCTYPHI;


GRANT SELECT ON SDSADM.RUPD$_STD_DECORATNDOCTYPHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DECORATIONTYPEHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DECORATIONTYPEHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DECORATIONTYPEHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DECORATIONTYPEHI FOR SDSADM.RUPD$_STD_DECORATIONTYPEHI;


GRANT SELECT ON SDSADM.RUPD$_STD_DECORATIONTYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DECORATIONTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DECORATIONTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DECORATIONTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DECORATIONTYPE FOR SDSADM.RUPD$_STD_DECORATIONTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_DECORATIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DECORATIONSTATUS1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DECORATIONSTATUS1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DECORATIONSTATUS1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DECORATIONSTATUS1 FOR SDSADM.RUPD$_STD_DECORATIONSTATUS1;


GRANT SELECT ON SDSADM.RUPD$_STD_DECORATIONSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DECORATIONSTATUS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DECORATIONSTATUS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DECORATIONSTATUS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DECORATIONSTATUS FOR SDSADM.RUPD$_STD_DECORATIONSTATUS;


GRANT SELECT ON SDSADM.RUPD$_STD_DECORATIONSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DECORATIONDOCUME CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DECORATIONDOCUME
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DECORATIONDOCUME IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DECORATIONDOCUME FOR SDSADM.RUPD$_STD_DECORATIONDOCUME;


GRANT SELECT ON SDSADM.RUPD$_STD_DECORATIONDOCUME TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DEATHNOTIFICATIO1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DEATHNOTIFICATIO1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DEATHNOTIFICATIO1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DEATHNOTIFICATIO1 FOR SDSADM.RUPD$_STD_DEATHNOTIFICATIO1;


GRANT SELECT ON SDSADM.RUPD$_STD_DEATHNOTIFICATIO1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DEATHNOTIFICATIO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DEATHNOTIFICATIO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DEATHNOTIFICATIO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DEATHNOTIFICATIO FOR SDSADM.RUPD$_STD_DEATHNOTIFICATIO;


GRANT SELECT ON SDSADM.RUPD$_STD_DEATHNOTIFICATIO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DATACOLLECTJOBTY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DATACOLLECTJOBTY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DATACOLLECTJOBTY1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DATACOLLECTJOBTY1 FOR SDSADM.RUPD$_STD_DATACOLLECTJOBTY1;


GRANT SELECT ON SDSADM.RUPD$_STD_DATACOLLECTJOBTY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DATACOLLECTJOBTY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DATACOLLECTJOBTY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DATACOLLECTJOBTY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DATACOLLECTJOBTY FOR SDSADM.RUPD$_STD_DATACOLLECTJOBTY;


GRANT SELECT ON SDSADM.RUPD$_STD_DATACOLLECTJOBTY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DATACHANGESOURCE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DATACHANGESOURCE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DATACHANGESOURCE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DATACHANGESOURCE1 FOR SDSADM.RUPD$_STD_DATACHANGESOURCE1;


GRANT SELECT ON SDSADM.RUPD$_STD_DATACHANGESOURCE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DATACHANGESOURCE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DATACHANGESOURCE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DATACHANGESOURCE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DATACHANGESOURCE FOR SDSADM.RUPD$_STD_DATACHANGESOURCE;


GRANT SELECT ON SDSADM.RUPD$_STD_DATACHANGESOURCE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_DATABASEVERSION CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_DATABASEVERSION
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_DATABASEVERSION IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_DATABASEVERSION FOR SDSADM.RUPD$_STD_DATABASEVERSION;


GRANT SELECT ON SDSADM.RUPD$_STD_DATABASEVERSION TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COUNTYHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COUNTYHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COUNTYHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COUNTYHISTORY FOR SDSADM.RUPD$_STD_COUNTYHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_COUNTYHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COUNTY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COUNTY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COUNTY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COUNTY FOR SDSADM.RUPD$_STD_COUNTY;


GRANT SELECT ON SDSADM.RUPD$_STD_COUNTY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COUNTRYHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COUNTRYHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COUNTRYHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COUNTRYHISTORY FOR SDSADM.RUPD$_STD_COUNTRYHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_COUNTRYHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COUNTRY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COUNTRY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COUNTRY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COUNTRY FOR SDSADM.RUPD$_STD_COUNTRY;


GRANT SELECT ON SDSADM.RUPD$_STD_COUNTRY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CORRESPONDENCETY1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CORRESPONDENCETY1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CORRESPONDENCETY1 IS 'temporary updatable snapshot log';


GRANT SELECT ON SDSADM.RUPD$_STD_CORRESPONDENCETY1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CORRESPONDENCETY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CORRESPONDENCETY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CORRESPONDENCETY IS 'temporary updatable snapshot log';


GRANT SELECT ON SDSADM.RUPD$_STD_CORRESPONDENCETY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CONFIDENTIALADDR CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CONFIDENTIALADDR
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CONFIDENTIALADDR IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CONFIDENTIALADDR FOR SDSADM.RUPD$_STD_CONFIDENTIALADDR;


GRANT SELECT ON SDSADM.RUPD$_STD_CONFIDENTIALADDR TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CONFADDRCATHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CONFADDRCATHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CONFADDRCATHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CONFADDRCATHISTO FOR SDSADM.RUPD$_STD_CONFADDRCATHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_CONFADDRCATHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CONDITIONCODEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CONDITIONCODEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CONDITIONCODEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CONDITIONCODEHIS FOR SDSADM.RUPD$_STD_CONDITIONCODEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_CONDITIONCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CONDITIONCODE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CONDITIONCODE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CONDITIONCODE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CONDITIONCODE FOR SDSADM.RUPD$_STD_CONDITIONCODE;


GRANT SELECT ON SDSADM.RUPD$_STD_CONDITIONCODE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COMBATSVCSOURCEH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COMBATSVCSOURCEH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COMBATSVCSOURCEH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COMBATSVCSOURCEH FOR SDSADM.RUPD$_STD_COMBATSVCSOURCEH;


GRANT SELECT ON SDSADM.RUPD$_STD_COMBATSVCSOURCEH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COMBATSVCSOURCE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COMBATSVCSOURCE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COMBATSVCSOURCE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COMBATSVCSOURCE FOR SDSADM.RUPD$_STD_COMBATSVCSOURCE;


GRANT SELECT ON SDSADM.RUPD$_STD_COMBATSVCSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COMBATSVCLOCATIO1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COMBATSVCLOCATIO1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COMBATSVCLOCATIO1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COMBATSVCLOCATIO1 FOR SDSADM.RUPD$_STD_COMBATSVCLOCATIO1;


GRANT SELECT ON SDSADM.RUPD$_STD_COMBATSVCLOCATIO1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COMBATSVCLOCATIO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COMBATSVCLOCATIO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COMBATSVCLOCATIO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COMBATSVCLOCATIO FOR SDSADM.RUPD$_STD_COMBATSVCLOCATIO;


GRANT SELECT ON SDSADM.RUPD$_STD_COMBATSVCLOCATIO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COMBATPAYTYPEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COMBATPAYTYPEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COMBATPAYTYPEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COMBATPAYTYPEHIS FOR SDSADM.RUPD$_STD_COMBATPAYTYPEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_COMBATPAYTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COMBATPAYTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COMBATPAYTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COMBATPAYTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COMBATPAYTYPE FOR SDSADM.RUPD$_STD_COMBATPAYTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_COMBATPAYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COMBATLOCATIONHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COMBATLOCATIONHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COMBATLOCATIONHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COMBATLOCATIONHI FOR SDSADM.RUPD$_STD_COMBATLOCATIONHI;


GRANT SELECT ON SDSADM.RUPD$_STD_COMBATLOCATIONHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COMBATLOCATION CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COMBATLOCATION
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COMBATLOCATION IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COMBATLOCATION FOR SDSADM.RUPD$_STD_COMBATLOCATION;


GRANT SELECT ON SDSADM.RUPD$_STD_COMBATLOCATION TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COLLECTIONMETHOD CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COLLECTIONMETHOD
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COLLECTIONMETHOD IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COLLECTIONMETHOD FOR SDSADM.RUPD$_STD_COLLECTIONMETHOD;


GRANT SELECT ON SDSADM.RUPD$_STD_COLLECTIONMETHOD TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_COLLECTIONHISTOR CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_COLLECTIONHISTOR
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_COLLECTIONHISTOR IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_COLLECTIONHISTOR FOR SDSADM.RUPD$_STD_COLLECTIONHISTOR;


GRANT SELECT ON SDSADM.RUPD$_STD_COLLECTIONHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CODINGSYSTEMHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CODINGSYSTEMHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CODINGSYSTEMHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CODINGSYSTEMHIST FOR SDSADM.RUPD$_STD_CODINGSYSTEMHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_CODINGSYSTEMHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CODINGSYSTEM CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CODINGSYSTEM
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CODINGSYSTEM IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CODINGSYSTEM FOR SDSADM.RUPD$_STD_CODINGSYSTEM;


GRANT SELECT ON SDSADM.RUPD$_STD_CODINGSYSTEM TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CODESET CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CODESET
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CODESET IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CODESET FOR SDSADM.RUPD$_STD_CODESET;


GRANT SELECT ON SDSADM.RUPD$_STD_CODESET TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CLINDETERTYPEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CLINDETERTYPEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CLINDETERTYPEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CLINDETERTYPEHIS FOR SDSADM.RUPD$_STD_CLINDETERTYPEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_CLINDETERTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CLINDETERTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CLINDETERTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CLINDETERTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CLINDETERTYPE FOR SDSADM.RUPD$_STD_CLINDETERTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_CLINDETERTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CATADISABILITYEX1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CATADISABILITYEX1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CATADISABILITYEX1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CATADISABILITYEX1 FOR SDSADM.RUPD$_STD_CATADISABILITYEX1;


GRANT SELECT ON SDSADM.RUPD$_STD_CATADISABILITYEX1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CATADISABILITYEX CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CATADISABILITYEX
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CATADISABILITYEX IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CATADISABILITYEX FOR SDSADM.RUPD$_STD_CATADISABILITYEX;


GRANT SELECT ON SDSADM.RUPD$_STD_CATADISABILITYEX TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CANCELDECLINESTT1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CANCELDECLINESTT1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CANCELDECLINESTT1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CANCELDECLINESTT1 FOR SDSADM.RUPD$_STD_CANCELDECLINESTT1;


GRANT SELECT ON SDSADM.RUPD$_STD_CANCELDECLINESTT1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CANCELDECLINESTT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CANCELDECLINESTT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CANCELDECLINESTT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CANCELDECLINESTT FOR SDSADM.RUPD$_STD_CANCELDECLINESTT;


GRANT SELECT ON SDSADM.RUPD$_STD_CANCELDECLINESTT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CANCELDECLINEREA CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CANCELDECLINEREA
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CANCELDECLINEREA IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CANCELDECLINEREA FOR SDSADM.RUPD$_STD_CANCELDECLINEREA;


GRANT SELECT ON SDSADM.RUPD$_STD_CANCELDECLINEREA TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_CANCELDECLINEHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_CANCELDECLINEHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_CANCELDECLINEHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_CANCELDECLINEHIS FOR SDSADM.RUPD$_STD_CANCELDECLINEHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_CANCELDECLINEHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_BILLINGTRANSTYPE1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_BILLINGTRANSTYPE1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_BILLINGTRANSTYPE1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_BILLINGTRANSTYPE1 FOR SDSADM.RUPD$_STD_BILLINGTRANSTYPE1;


GRANT SELECT ON SDSADM.RUPD$_STD_BILLINGTRANSTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_BILLINGTRANSTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_BILLINGTRANSTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_BILLINGTRANSTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_BILLINGTRANSTYPE FOR SDSADM.RUPD$_STD_BILLINGTRANSTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_BILLINGTRANSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_BENEFITSCOORDTYP1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_BENEFITSCOORDTYP1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_BENEFITSCOORDTYP1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_BENEFITSCOORDTYP1 FOR SDSADM.RUPD$_STD_BENEFITSCOORDTYP1;


GRANT SELECT ON SDSADM.RUPD$_STD_BENEFITSCOORDTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_BENEFITSCOORDTYP CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_BENEFITSCOORDTYP
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_BENEFITSCOORDTYP IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_BENEFITSCOORDTYP FOR SDSADM.RUPD$_STD_BENEFITSCOORDTYP;


GRANT SELECT ON SDSADM.RUPD$_STD_BENEFITSCOORDTYP TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ASSIGNINGAUTHORI1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ASSIGNINGAUTHORI1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ASSIGNINGAUTHORI1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ASSIGNINGAUTHORI1 FOR SDSADM.RUPD$_STD_ASSIGNINGAUTHORI1;


GRANT SELECT ON SDSADM.RUPD$_STD_ASSIGNINGAUTHORI1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ASSIGNINGAUTHORI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ASSIGNINGAUTHORI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ASSIGNINGAUTHORI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ASSIGNINGAUTHORI FOR SDSADM.RUPD$_STD_ASSIGNINGAUTHORI;


GRANT SELECT ON SDSADM.RUPD$_STD_ASSIGNINGAUTHORI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ASSETTYPEHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ASSETTYPEHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ASSETTYPEHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ASSETTYPEHISTORY FOR SDSADM.RUPD$_STD_ASSETTYPEHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_ASSETTYPEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ASSETTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ASSETTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ASSETTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ASSETTYPE FOR SDSADM.RUPD$_STD_ASSETTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_ASSETTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_APPLICATIONHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_APPLICATIONHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_APPLICATIONHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_APPLICATIONHISTO FOR SDSADM.RUPD$_STD_APPLICATIONHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_APPLICATIONHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_APPLICATION CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_APPLICATION
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_APPLICATION IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_APPLICATION FOR SDSADM.RUPD$_STD_APPLICATION;


GRANT SELECT ON SDSADM.RUPD$_STD_APPLICATION TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ALLIEDCOUNTRYHIS CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ALLIEDCOUNTRYHIS
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ALLIEDCOUNTRYHIS IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ALLIEDCOUNTRYHIS FOR SDSADM.RUPD$_STD_ALLIEDCOUNTRYHIS;


GRANT SELECT ON SDSADM.RUPD$_STD_ALLIEDCOUNTRYHIS TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ALLIEDCOUNTRY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ALLIEDCOUNTRY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ALLIEDCOUNTRY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ALLIEDCOUNTRY FOR SDSADM.RUPD$_STD_ALLIEDCOUNTRY;


GRANT SELECT ON SDSADM.RUPD$_STD_ALLIEDCOUNTRY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_AGENTORANGELOCNH CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_AGENTORANGELOCNH
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_AGENTORANGELOCNH IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_AGENTORANGELOCNH FOR SDSADM.RUPD$_STD_AGENTORANGELOCNH;


GRANT SELECT ON SDSADM.RUPD$_STD_AGENTORANGELOCNH TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_AGENTORANGELOCAT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_AGENTORANGELOCAT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_AGENTORANGELOCAT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_AGENTORANGELOCAT FOR SDSADM.RUPD$_STD_AGENTORANGELOCAT;


GRANT SELECT ON SDSADM.RUPD$_STD_AGENTORANGELOCAT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_AGENCYHISTORY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_AGENCYHISTORY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_AGENCYHISTORY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_AGENCYHISTORY FOR SDSADM.RUPD$_STD_AGENCYHISTORY;


GRANT SELECT ON SDSADM.RUPD$_STD_AGENCYHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_AGENCY CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_AGENCY
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_AGENCY IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_AGENCY FOR SDSADM.RUPD$_STD_AGENCY;


GRANT SELECT ON SDSADM.RUPD$_STD_AGENCY TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_AFFECTEDEXTREMIT1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_AFFECTEDEXTREMIT1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_AFFECTEDEXTREMIT1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_AFFECTEDEXTREMIT1 FOR SDSADM.RUPD$_STD_AFFECTEDEXTREMIT1;


GRANT SELECT ON SDSADM.RUPD$_STD_AFFECTEDEXTREMIT1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_AFFECTEDEXTREMIT CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_AFFECTEDEXTREMIT
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_AFFECTEDEXTREMIT IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_AFFECTEDEXTREMIT FOR SDSADM.RUPD$_STD_AFFECTEDEXTREMIT;


GRANT SELECT ON SDSADM.RUPD$_STD_AFFECTEDEXTREMIT TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ADRSINVALRSNHIST CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ADRSINVALRSNHIST
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ADRSINVALRSNHIST IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ADRSINVALRSNHIST FOR SDSADM.RUPD$_STD_ADRSINVALRSNHIST;


GRANT SELECT ON SDSADM.RUPD$_STD_ADRSINVALRSNHIST TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ADRSDLVRYFLRCDHI CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ADRSDLVRYFLRCDHI
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ADRSDLVRYFLRCDHI IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ADRSDLVRYFLRCDHI FOR SDSADM.RUPD$_STD_ADRSDLVRYFLRCDHI;


GRANT SELECT ON SDSADM.RUPD$_STD_ADRSDLVRYFLRCDHI TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ADMINISTRATIVEEN CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ADMINISTRATIVEEN
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ADMINISTRATIVEEN IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ADMINISTRATIVEEN FOR SDSADM.RUPD$_STD_ADMINISTRATIVEEN;


GRANT SELECT ON SDSADM.RUPD$_STD_ADMINISTRATIVEEN TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ADDRESSTYPEHISTO CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ADDRESSTYPEHISTO
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ADDRESSTYPEHISTO IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ADDRESSTYPEHISTO FOR SDSADM.RUPD$_STD_ADDRESSTYPEHISTO;


GRANT SELECT ON SDSADM.RUPD$_STD_ADDRESSTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ADDRESSTYPE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ADDRESSTYPE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ADDRESSTYPE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ADDRESSTYPE FOR SDSADM.RUPD$_STD_ADDRESSTYPE;


GRANT SELECT ON SDSADM.RUPD$_STD_ADDRESSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ADDRESSINVALIDRE CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ADDRESSINVALIDRE
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ADDRESSINVALIDRE IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ADDRESSINVALIDRE FOR SDSADM.RUPD$_STD_ADDRESSINVALIDRE;


GRANT SELECT ON SDSADM.RUPD$_STD_ADDRESSINVALIDRE TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ADDRESSDELIVERYF CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ADDRESSDELIVERYF
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ADDRESSDELIVERYF IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ADDRESSDELIVERYF FOR SDSADM.RUPD$_STD_ADDRESSDELIVERYF;


GRANT SELECT ON SDSADM.RUPD$_STD_ADDRESSDELIVERYF TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ADDRESSCHANGESOU1 CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ADDRESSCHANGESOU1
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ADDRESSCHANGESOU1 IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ADDRESSCHANGESOU1 FOR SDSADM.RUPD$_STD_ADDRESSCHANGESOU1;


GRANT SELECT ON SDSADM.RUPD$_STD_ADDRESSCHANGESOU1 TO SDS_PROXY;
DROP TABLE SDSADM.RUPD$_STD_ADDRESSCHANGESOU CASCADE CONSTRAINTS;

CREATE GLOBAL TEMPORARY TABLE SDSADM.RUPD$_STD_ADDRESSCHANGESOU
(
  ID               NUMBER(20),
  DMLTYPE$$        VARCHAR2(1 BYTE),
  SNAPID           INTEGER,
  CHANGE_VECTOR$$  RAW(255)
)
ON COMMIT PRESERVE ROWS
RESULT_CACHE (MODE DEFAULT)
NOCACHE;

COMMENT ON TABLE SDSADM.RUPD$_STD_ADDRESSCHANGESOU IS 'temporary updatable snapshot log';


CREATE OR REPLACE PUBLIC SYNONYM RUPD$_STD_ADDRESSCHANGESOU FOR SDSADM.RUPD$_STD_ADDRESSCHANGESOU;


GRANT SELECT ON SDSADM.RUPD$_STD_ADDRESSCHANGESOU TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPTOMSAHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPTOMSAHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPTOMSAHISTORY IS 'snapshot log for master table SDSADM.STD_ZIPTOMSAHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPTOMSAHISTORY FOR SDSADM.MLOG$_STD_ZIPTOMSAHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPTOMSAHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPTOMSA CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPTOMSA
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPTOMSA IS 'snapshot log for master table SDSADM.STD_ZIPTOMSA';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPTOMSA FOR SDSADM.MLOG$_STD_ZIPTOMSA;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPTOMSA TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPPLACEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPPLACEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPPLACEHISTORY IS 'snapshot log for master table SDSADM.STD_ZIPPLACEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPPLACEHISTORY FOR SDSADM.MLOG$_STD_ZIPPLACEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPPLACEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPPLACEFACILITY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPPLACEFACILITY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPPLACEFACILITY1 IS 'snapshot log for master table SDSADM.STD_ZIPPLACEFACILITYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPPLACEFACILITY1 FOR SDSADM.MLOG$_STD_ZIPPLACEFACILITY1;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPPLACEFACILITY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPPLACEFACILITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPPLACEFACILITY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPPLACEFACILITY IS 'snapshot log for master table SDSADM.STD_ZIPPLACEFACILITY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPPLACEFACILITY FOR SDSADM.MLOG$_STD_ZIPPLACEFACILITY;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPPLACEFACILITY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPPLACE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPPLACE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPPLACE IS 'snapshot log for master table SDSADM.STD_ZIPPLACE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPPLACE FOR SDSADM.MLOG$_STD_ZIPPLACE;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPPLACE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPCODEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPCODEHISTORY IS 'snapshot log for master table SDSADM.STD_ZIPCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPCODEHISTORY FOR SDSADM.MLOG$_STD_ZIPCODEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPCODEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPCODE IS 'snapshot log for master table SDSADM.STD_ZIPCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPCODE FOR SDSADM.MLOG$_STD_ZIPCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPCLASSIFICATIO1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPCLASSIFICATIO1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPCLASSIFICATIO1 IS 'snapshot log for master table SDSADM.STD_ZIPCLASSIFICATIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPCLASSIFICATIO1 FOR SDSADM.MLOG$_STD_ZIPCLASSIFICATIO1;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPCLASSIFICATIO1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPCLASSIFICATIO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPCLASSIFICATIO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPCLASSIFICATIO IS 'snapshot log for master table SDSADM.STD_ZIPCLASSIFICATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPCLASSIFICATIO FOR SDSADM.MLOG$_STD_ZIPCLASSIFICATIO;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPCLASSIFICATIO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ZIPASSIGNMENT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ZIPASSIGNMENT
(
  ZIPCODE_ID       NUMBER(20),
  ZIPPLACE_ID      NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ZIPASSIGNMENT IS 'snapshot log for master table SDSADM.STD_ZIPASSIGNMENT';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ZIPASSIGNMENT FOR SDSADM.MLOG$_STD_ZIPASSIGNMENT;


GRANT SELECT ON SDSADM.MLOG$_STD_ZIPASSIGNMENT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_YESNOCODEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_YESNOCODEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_YESNOCODEHISTORY IS 'snapshot log for master table SDSADM.STD_YESNOCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_YESNOCODEHISTORY FOR SDSADM.MLOG$_STD_YESNOCODEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_YESNOCODEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_YESNOCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_YESNOCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_YESNOCODE IS 'snapshot log for master table SDSADM.STD_YESNOCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_YESNOCODE FOR SDSADM.MLOG$_STD_YESNOCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_YESNOCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_VBAQUERYSTATUSTY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_VBAQUERYSTATUSTY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_VBAQUERYSTATUSTY1 IS 'snapshot log for master table SDSADM.STD_VBAQUERYSTATUSTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_VBAQUERYSTATUSTY1 FOR SDSADM.MLOG$_STD_VBAQUERYSTATUSTY1;


GRANT SELECT ON SDSADM.MLOG$_STD_VBAQUERYSTATUSTY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_VBAQUERYSTATUSTY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_VBAQUERYSTATUSTY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_VBAQUERYSTATUSTY IS 'snapshot log for master table SDSADM.STD_VBAQUERYSTATUSTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_VBAQUERYSTATUSTY FOR SDSADM.MLOG$_STD_VBAQUERYSTATUSTY;


GRANT SELECT ON SDSADM.MLOG$_STD_VBAQUERYSTATUSTY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_USERGROUPTYPEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_USERGROUPTYPEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_USERGROUPTYPEHIS IS 'snapshot log for master table SDSADM.STD_USERGROUPTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_USERGROUPTYPEHIS FOR SDSADM.MLOG$_STD_USERGROUPTYPEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_USERGROUPTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_USERGROUPTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_USERGROUPTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_USERGROUPTYPE IS 'snapshot log for master table SDSADM.STD_USERGROUPTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_USERGROUPTYPE FOR SDSADM.MLOG$_STD_USERGROUPTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_USERGROUPTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_TRANSACTIONTYPEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_TRANSACTIONTYPEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_TRANSACTIONTYPEH IS 'snapshot log for master table SDSADM.STD_TRANSACTIONTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_TRANSACTIONTYPEH FOR SDSADM.MLOG$_STD_TRANSACTIONTYPEH;


GRANT SELECT ON SDSADM.MLOG$_STD_TRANSACTIONTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_TRANSACTIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_TRANSACTIONTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_TRANSACTIONTYPE IS 'snapshot log for master table SDSADM.STD_TRANSACTIONTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_TRANSACTIONTYPE FOR SDSADM.MLOG$_STD_TRANSACTIONTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_TRANSACTIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_TERMINATIONREASO1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_TERMINATIONREASO1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_TERMINATIONREASO1 IS 'snapshot log for master table SDSADM.STD_TERMINATIONREASON';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_TERMINATIONREASO1 FOR SDSADM.MLOG$_STD_TERMINATIONREASO1;


GRANT SELECT ON SDSADM.MLOG$_STD_TERMINATIONREASO1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_TERMINATIONREASO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_TERMINATIONREASO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_TERMINATIONREASO IS 'snapshot log for master table SDSADM.STD_TERMINATIONREASONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_TERMINATIONREASO FOR SDSADM.MLOG$_STD_TERMINATIONREASO;


GRANT SELECT ON SDSADM.MLOG$_STD_TERMINATIONREASO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SVCDSCHRGCDHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SVCDSCHRGCDHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SVCDSCHRGCDHISTO IS 'snapshot log for master table SDSADM.STD_SVCDSCHRGCDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SVCDSCHRGCDHISTO FOR SDSADM.MLOG$_STD_SVCDSCHRGCDHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_SVCDSCHRGCDHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_STATISTICALAREAT1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_STATISTICALAREAT1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_STATISTICALAREAT1 IS 'snapshot log for master table SDSADM.STD_STATISTICALAREATYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_STATISTICALAREAT1 FOR SDSADM.MLOG$_STD_STATISTICALAREAT1;


GRANT SELECT ON SDSADM.MLOG$_STD_STATISTICALAREAT1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_STATISTICALAREAT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_STATISTICALAREAT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_STATISTICALAREAT IS 'snapshot log for master table SDSADM.STD_STATISTICALAREATYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_STATISTICALAREAT FOR SDSADM.MLOG$_STD_STATISTICALAREAT;


GRANT SELECT ON SDSADM.MLOG$_STD_STATISTICALAREAT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_STATISTICALAREAH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_STATISTICALAREAH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_STATISTICALAREAH IS 'snapshot log for master table SDSADM.STD_STATISTICALAREAHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_STATISTICALAREAH FOR SDSADM.MLOG$_STD_STATISTICALAREAH;


GRANT SELECT ON SDSADM.MLOG$_STD_STATISTICALAREAH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_STATISTICALAREA CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_STATISTICALAREA
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_STATISTICALAREA IS 'snapshot log for master table SDSADM.STD_STATISTICALAREA';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_STATISTICALAREA FOR SDSADM.MLOG$_STD_STATISTICALAREA;


GRANT SELECT ON SDSADM.MLOG$_STD_STATISTICALAREA TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_STATEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_STATEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_STATEHISTORY IS 'snapshot log for master table SDSADM.STD_STATEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_STATEHISTORY FOR SDSADM.MLOG$_STD_STATEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_STATEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_STATE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_STATE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_STATE IS 'snapshot log for master table SDSADM.STD_STATE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_STATE FOR SDSADM.MLOG$_STD_STATE;


GRANT SELECT ON SDSADM.MLOG$_STD_STATE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_STATCNTYXREF CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_STATCNTYXREF
(
  COUNTY_ID           NUMBER(20),
  STATISTICALAREA_ID  NUMBER(20),
  SNAPTIME$$          DATE,
  DMLTYPE$$           VARCHAR2(1 BYTE),
  OLD_NEW$$           VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$     RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_STATCNTYXREF IS 'snapshot log for master table SDSADM.STD_STATCNTYXREF';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_STATCNTYXREF FOR SDSADM.MLOG$_STD_STATCNTYXREF;


GRANT SELECT ON SDSADM.MLOG$_STD_STATCNTYXREF TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSNVERIFSTATUSHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSNVERIFSTATUSHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSNVERIFSTATUSHI IS 'snapshot log for master table SDSADM.STD_SSNVERIFSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSNVERIFSTATUSHI FOR SDSADM.MLOG$_STD_SSNVERIFSTATUSHI;


GRANT SELECT ON SDSADM.MLOG$_STD_SSNVERIFSTATUSHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSNVERIFICATIONS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSNVERIFICATIONS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSNVERIFICATIONS IS 'snapshot log for master table SDSADM.STD_SSNVERIFICATIONSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSNVERIFICATIONS FOR SDSADM.MLOG$_STD_SSNVERIFICATIONS;


GRANT SELECT ON SDSADM.MLOG$_STD_SSNVERIFICATIONS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSNTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSNTYPEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSNTYPEHISTORY IS 'snapshot log for master table SDSADM.STD_SSNTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSNTYPEHISTORY FOR SDSADM.MLOG$_STD_SSNTYPEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_SSNTYPEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSNTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSNTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSNTYPE IS 'snapshot log for master table SDSADM.STD_SSNTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSNTYPE FOR SDSADM.MLOG$_STD_SSNTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_SSNTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSNCHANGESOURCEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSNCHANGESOURCEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSNCHANGESOURCEH IS 'snapshot log for master table SDSADM.STD_SSNCHANGESOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSNCHANGESOURCEH FOR SDSADM.MLOG$_STD_SSNCHANGESOURCEH;


GRANT SELECT ON SDSADM.MLOG$_STD_SSNCHANGESOURCEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSNCHANGESOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSNCHANGESOURCE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSNCHANGESOURCE IS 'snapshot log for master table SDSADM.STD_SSNCHANGESOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSNCHANGESOURCE FOR SDSADM.MLOG$_STD_SSNCHANGESOURCE;


GRANT SELECT ON SDSADM.MLOG$_STD_SSNCHANGESOURCE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSAVERIFCODEHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSAVERIFCODEHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSAVERIFCODEHIST IS 'snapshot log for master table SDSADM.STD_SSAVERIFCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSAVERIFCODEHIST FOR SDSADM.MLOG$_STD_SSAVERIFCODEHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_SSAVERIFCODEHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSAVERIFCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSAVERIFCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSAVERIFCODE IS 'snapshot log for master table SDSADM.STD_SSAVERIFCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSAVERIFCODE FOR SDSADM.MLOG$_STD_SSAVERIFCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_SSAVERIFCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSAMESSAGETYPEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSAMESSAGETYPEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSAMESSAGETYPEHI IS 'snapshot log for master table SDSADM.STD_SSAMESSAGETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSAMESSAGETYPEHI FOR SDSADM.MLOG$_STD_SSAMESSAGETYPEHI;


GRANT SELECT ON SDSADM.MLOG$_STD_SSAMESSAGETYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SSAMESSAGETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SSAMESSAGETYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SSAMESSAGETYPE IS 'snapshot log for master table SDSADM.STD_SSAMESSAGETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SSAMESSAGETYPE FOR SDSADM.MLOG$_STD_SSAMESSAGETYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_SSAMESSAGETYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SPINALINJURYCODE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SPINALINJURYCODE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SPINALINJURYCODE1 IS 'snapshot log for master table SDSADM.STD_SPINALINJURYCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SPINALINJURYCODE1 FOR SDSADM.MLOG$_STD_SPINALINJURYCODE1;


GRANT SELECT ON SDSADM.MLOG$_STD_SPINALINJURYCODE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SPINALINJURYCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SPINALINJURYCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SPINALINJURYCODE IS 'snapshot log for master table SDSADM.STD_SPINALINJURYCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SPINALINJURYCODE FOR SDSADM.MLOG$_STD_SPINALINJURYCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_SPINALINJURYCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SPECIALTYSERVICE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SPECIALTYSERVICE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SPECIALTYSERVICE1 IS 'snapshot log for master table SDSADM.STD_SPECIALTYSERVICEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SPECIALTYSERVICE1 FOR SDSADM.MLOG$_STD_SPECIALTYSERVICE1;


GRANT SELECT ON SDSADM.MLOG$_STD_SPECIALTYSERVICE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SPECIALTYSERVICE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SPECIALTYSERVICE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SPECIALTYSERVICE IS 'snapshot log for master table SDSADM.STD_SPECIALTYSERVICE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SPECIALTYSERVICE FOR SDSADM.MLOG$_STD_SPECIALTYSERVICE;


GRANT SELECT ON SDSADM.MLOG$_STD_SPECIALTYSERVICE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SPECIALOPERATION1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SPECIALOPERATION1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SPECIALOPERATION1 IS 'snapshot log for master table SDSADM.STD_SPECIALOPERATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SPECIALOPERATION1 FOR SDSADM.MLOG$_STD_SPECIALOPERATION1;


GRANT SELECT ON SDSADM.MLOG$_STD_SPECIALOPERATION1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SPECIALOPERATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SPECIALOPERATION
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SPECIALOPERATION IS 'snapshot log for master table SDSADM.STD_SPECIALOPERATIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SPECIALOPERATION FOR SDSADM.MLOG$_STD_SPECIALOPERATION;


GRANT SELECT ON SDSADM.MLOG$_STD_SPECIALOPERATION TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SPECIALFACTORMAP1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SPECIALFACTORMAP1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SPECIALFACTORMAP1 IS 'snapshot log for master table SDSADM.STD_SPECIALFACTORMAPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SPECIALFACTORMAP1 FOR SDSADM.MLOG$_STD_SPECIALFACTORMAP1;


GRANT SELECT ON SDSADM.MLOG$_STD_SPECIALFACTORMAP1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SPECIALFACTORMAP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SPECIALFACTORMAP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SPECIALFACTORMAP IS 'snapshot log for master table SDSADM.STD_SPECIALFACTORMAP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SPECIALFACTORMAP FOR SDSADM.MLOG$_STD_SPECIALFACTORMAP;


GRANT SELECT ON SDSADM.MLOG$_STD_SPECIALFACTORMAP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SITEUPLOADSTATUS1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SITEUPLOADSTATUS1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SITEUPLOADSTATUS1 IS 'snapshot log for master table SDSADM.STD_SITEUPLOADSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SITEUPLOADSTATUS1 FOR SDSADM.MLOG$_STD_SITEUPLOADSTATUS1;


GRANT SELECT ON SDSADM.MLOG$_STD_SITEUPLOADSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SITEUPLOADSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SITEUPLOADSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SITEUPLOADSTATUS IS 'snapshot log for master table SDSADM.STD_SITEUPLOADSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SITEUPLOADSTATUS FOR SDSADM.MLOG$_STD_SITEUPLOADSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_SITEUPLOADSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SIGNATUREINDTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SIGNATUREINDTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SIGNATUREINDTYPE1 IS 'snapshot log for master table SDSADM.STD_SIGNATUREINDTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SIGNATUREINDTYPE1 FOR SDSADM.MLOG$_STD_SIGNATUREINDTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_SIGNATUREINDTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SIGNATUREINDTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SIGNATUREINDTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SIGNATUREINDTYPE IS 'snapshot log for master table SDSADM.STD_SIGNATUREINDTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SIGNATUREINDTYPE FOR SDSADM.MLOG$_STD_SIGNATUREINDTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_SIGNATUREINDTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SHADDOCUMENTTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SHADDOCUMENTTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SHADDOCUMENTTYPE1 IS 'snapshot log for master table SDSADM.STD_SHADDOCUMENTTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SHADDOCUMENTTYPE1 FOR SDSADM.MLOG$_STD_SHADDOCUMENTTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_SHADDOCUMENTTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SHADDOCUMENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SHADDOCUMENTTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SHADDOCUMENTTYPE IS 'snapshot log for master table SDSADM.STD_SHADDOCUMENTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SHADDOCUMENTTYPE FOR SDSADM.MLOG$_STD_SHADDOCUMENTTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_SHADDOCUMENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SERVICEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SERVICEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SERVICEHISTORY IS 'snapshot log for master table SDSADM.STD_SERVICEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SERVICEHISTORY FOR SDSADM.MLOG$_STD_SERVICEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_SERVICEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SERVICEDISCHARGE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SERVICEDISCHARGE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SERVICEDISCHARGE IS 'snapshot log for master table SDSADM.STD_SERVICEDISCHARGECODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SERVICEDISCHARGE FOR SDSADM.MLOG$_STD_SERVICEDISCHARGE;


GRANT SELECT ON SDSADM.MLOG$_STD_SERVICEDISCHARGE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SERVICEBRANCHHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SERVICEBRANCHHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SERVICEBRANCHHIS IS 'snapshot log for master table SDSADM.STD_SERVICEBRANCHHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SERVICEBRANCHHIS FOR SDSADM.MLOG$_STD_SERVICEBRANCHHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_SERVICEBRANCHHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SERVICEBRANCH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SERVICEBRANCH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SERVICEBRANCH IS 'snapshot log for master table SDSADM.STD_SERVICEBRANCH';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SERVICEBRANCH FOR SDSADM.MLOG$_STD_SERVICEBRANCH;


GRANT SELECT ON SDSADM.MLOG$_STD_SERVICEBRANCH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SERVICE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SERVICE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SERVICE IS 'snapshot log for master table SDSADM.STD_SERVICE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SERVICE FOR SDSADM.MLOG$_STD_SERVICE;


GRANT SELECT ON SDSADM.MLOG$_STD_SERVICE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SENSITIVITYCHNGS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SENSITIVITYCHNGS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SENSITIVITYCHNGS IS 'snapshot log for master table SDSADM.STD_SENSITIVITYCHNGSRCHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SENSITIVITYCHNGS FOR SDSADM.MLOG$_STD_SENSITIVITYCHNGS;


GRANT SELECT ON SDSADM.MLOG$_STD_SENSITIVITYCHNGS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SENSITIVITYCHANG CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SENSITIVITYCHANG
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SENSITIVITYCHANG IS 'snapshot log for master table SDSADM.STD_SENSITIVITYCHANGESOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SENSITIVITYCHANG FOR SDSADM.MLOG$_STD_SENSITIVITYCHANG;


GRANT SELECT ON SDSADM.MLOG$_STD_SENSITIVITYCHANG TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SEEDSTATUSCODEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SEEDSTATUSCODEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SEEDSTATUSCODEHI IS 'snapshot log for master table SDSADM.STD_SEEDSTATUSCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SEEDSTATUSCODEHI FOR SDSADM.MLOG$_STD_SEEDSTATUSCODEHI;


GRANT SELECT ON SDSADM.MLOG$_STD_SEEDSTATUSCODEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_SEEDSTATUSCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_SEEDSTATUSCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_SEEDSTATUSCODE IS 'snapshot log for master table SDSADM.STD_SEEDSTATUSCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_SEEDSTATUSCODE FOR SDSADM.MLOG$_STD_SEEDSTATUSCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_SEEDSTATUSCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELTOVETINSURANC1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELTOVETINSURANC1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELTOVETINSURANC1 IS 'snapshot log for master table SDSADM.STD_RELTOVETINSURANCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELTOVETINSURANC1 FOR SDSADM.MLOG$_STD_RELTOVETINSURANC1;


GRANT SELECT ON SDSADM.MLOG$_STD_RELTOVETINSURANC1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELTOVETINSURANC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELTOVETINSURANC
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELTOVETINSURANC IS 'snapshot log for master table SDSADM.STD_RELTOVETINSURANCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELTOVETINSURANC FOR SDSADM.MLOG$_STD_RELTOVETINSURANC;


GRANT SELECT ON SDSADM.MLOG$_STD_RELTOVETINSURANC TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELIGIONHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELIGIONHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELIGIONHISTORY IS 'snapshot log for master table SDSADM.STD_RELIGIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELIGIONHISTORY FOR SDSADM.MLOG$_STD_RELIGIONHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_RELIGIONHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELIGION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELIGION
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELIGION IS 'snapshot log for master table SDSADM.STD_RELIGION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELIGION FOR SDSADM.MLOG$_STD_RELIGION;


GRANT SELECT ON SDSADM.MLOG$_STD_RELIGION TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELATNLOPERATORH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELATNLOPERATORH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELATNLOPERATORH IS 'snapshot log for master table SDSADM.STD_RELATNLOPERATORHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELATNLOPERATORH FOR SDSADM.MLOG$_STD_RELATNLOPERATORH;


GRANT SELECT ON SDSADM.MLOG$_STD_RELATNLOPERATORH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELATNLCONJUNCTN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELATNLCONJUNCTN
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELATNLCONJUNCTN IS 'snapshot log for master table SDSADM.STD_RELATNLCONJUNCTNHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELATNLCONJUNCTN FOR SDSADM.MLOG$_STD_RELATNLCONJUNCTN;


GRANT SELECT ON SDSADM.MLOG$_STD_RELATNLCONJUNCTN TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELATIONSHIPHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELATIONSHIPHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELATIONSHIPHIST IS 'snapshot log for master table SDSADM.STD_RELATIONSHIPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELATIONSHIPHIST FOR SDSADM.MLOG$_STD_RELATIONSHIPHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_RELATIONSHIPHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELATIONSHIP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELATIONSHIP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELATIONSHIP IS 'snapshot log for master table SDSADM.STD_RELATIONSHIP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELATIONSHIP FOR SDSADM.MLOG$_STD_RELATIONSHIP;


GRANT SELECT ON SDSADM.MLOG$_STD_RELATIONSHIP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELATIONALOPERAT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELATIONALOPERAT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELATIONALOPERAT IS 'snapshot log for master table SDSADM.STD_RELATIONALOPERATOR';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELATIONALOPERAT FOR SDSADM.MLOG$_STD_RELATIONALOPERAT;


GRANT SELECT ON SDSADM.MLOG$_STD_RELATIONALOPERAT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RELATIONALCONJUN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RELATIONALCONJUN
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RELATIONALCONJUN IS 'snapshot log for master table SDSADM.STD_RELATIONALCONJUNCTION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RELATIONALCONJUN FOR SDSADM.MLOG$_STD_RELATIONALCONJUN;


GRANT SELECT ON SDSADM.MLOG$_STD_RELATIONALCONJUN TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_REJECTEDREMARKSH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_REJECTEDREMARKSH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_REJECTEDREMARKSH IS 'snapshot log for master table SDSADM.STD_REJECTEDREMARKSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_REJECTEDREMARKSH FOR SDSADM.MLOG$_STD_REJECTEDREMARKSH;


GRANT SELECT ON SDSADM.MLOG$_STD_REJECTEDREMARKSH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_REJECTEDREMARKS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_REJECTEDREMARKS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_REJECTEDREMARKS IS 'snapshot log for master table SDSADM.STD_REJECTEDREMARKS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_REJECTEDREMARKS FOR SDSADM.MLOG$_STD_REJECTEDREMARKS;


GRANT SELECT ON SDSADM.MLOG$_STD_REJECTEDREMARKS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_REGISTRYTYPEHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_REGISTRYTYPEHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_REGISTRYTYPEHIST IS 'snapshot log for master table SDSADM.STD_REGISTRYTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_REGISTRYTYPEHIST FOR SDSADM.MLOG$_STD_REGISTRYTYPEHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_REGISTRYTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_REGISTRYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_REGISTRYTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_REGISTRYTYPE IS 'snapshot log for master table SDSADM.STD_REGISTRYTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_REGISTRYTYPE FOR SDSADM.MLOG$_STD_REGISTRYTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_REGISTRYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RADIATNEXPSRMTHD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RADIATNEXPSRMTHD
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RADIATNEXPSRMTHD IS 'snapshot log for master table SDSADM.STD_RADIATNEXPSRMTHDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RADIATNEXPSRMTHD FOR SDSADM.MLOG$_STD_RADIATNEXPSRMTHD;


GRANT SELECT ON SDSADM.MLOG$_STD_RADIATNEXPSRMTHD TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RADIATIONEXPOSUR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RADIATIONEXPOSUR
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RADIATIONEXPOSUR IS 'snapshot log for master table SDSADM.STD_RADIATIONEXPOSUREMETHOD';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RADIATIONEXPOSUR FOR SDSADM.MLOG$_STD_RADIATIONEXPOSUR;


GRANT SELECT ON SDSADM.MLOG$_STD_RADIATIONEXPOSUR TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RACEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RACEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RACEHISTORY IS 'snapshot log for master table SDSADM.STD_RACEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RACEHISTORY FOR SDSADM.MLOG$_STD_RACEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_RACEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_RACE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_RACE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_RACE IS 'snapshot log for master table SDSADM.STD_RACE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_RACE FOR SDSADM.MLOG$_STD_RACE;


GRANT SELECT ON SDSADM.MLOG$_STD_RACE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PUBLICATIONTOPIC1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PUBLICATIONTOPIC1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PUBLICATIONTOPIC1 IS 'snapshot log for master table SDSADM.STD_PUBLICATIONTOPICHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PUBLICATIONTOPIC1 FOR SDSADM.MLOG$_STD_PUBLICATIONTOPIC1;


GRANT SELECT ON SDSADM.MLOG$_STD_PUBLICATIONTOPIC1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PUBLICATIONTOPIC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PUBLICATIONTOPIC
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PUBLICATIONTOPIC IS 'snapshot log for master table SDSADM.STD_PUBLICATIONTOPIC';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PUBLICATIONTOPIC FOR SDSADM.MLOG$_STD_PUBLICATIONTOPIC;


GRANT SELECT ON SDSADM.MLOG$_STD_PUBLICATIONTOPIC TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PTFDISCHARGECODE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PTFDISCHARGECODE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PTFDISCHARGECODE1 IS 'snapshot log for master table SDSADM.STD_PTFDISCHARGECODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PTFDISCHARGECODE1 FOR SDSADM.MLOG$_STD_PTFDISCHARGECODE1;


GRANT SELECT ON SDSADM.MLOG$_STD_PTFDISCHARGECODE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PTFDISCHARGECODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PTFDISCHARGECODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PTFDISCHARGECODE IS 'snapshot log for master table SDSADM.STD_PTFDISCHARGECODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PTFDISCHARGECODE FOR SDSADM.MLOG$_STD_PTFDISCHARGECODE;


GRANT SELECT ON SDSADM.MLOG$_STD_PTFDISCHARGECODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PSEUDOSSNREASONH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PSEUDOSSNREASONH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PSEUDOSSNREASONH IS 'snapshot log for master table SDSADM.STD_PSEUDOSSNREASONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PSEUDOSSNREASONH FOR SDSADM.MLOG$_STD_PSEUDOSSNREASONH;


GRANT SELECT ON SDSADM.MLOG$_STD_PSEUDOSSNREASONH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PSEUDOSSNREASON CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PSEUDOSSNREASON
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PSEUDOSSNREASON IS 'snapshot log for master table SDSADM.STD_PSEUDOSSNREASON';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PSEUDOSSNREASON FOR SDSADM.MLOG$_STD_PSEUDOSSNREASON;


GRANT SELECT ON SDSADM.MLOG$_STD_PSEUDOSSNREASON TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PROGRAMOFSTUDYHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PROGRAMOFSTUDYHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PROGRAMOFSTUDYHI IS 'snapshot log for master table SDSADM.STD_PROGRAMOFSTUDYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PROGRAMOFSTUDYHI FOR SDSADM.MLOG$_STD_PROGRAMOFSTUDYHI;


GRANT SELECT ON SDSADM.MLOG$_STD_PROGRAMOFSTUDYHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PROGRAMOFSTUDY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PROGRAMOFSTUDY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PROGRAMOFSTUDY IS 'snapshot log for master table SDSADM.STD_PROGRAMOFSTUDY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PROGRAMOFSTUDY FOR SDSADM.MLOG$_STD_PROGRAMOFSTUDY;


GRANT SELECT ON SDSADM.MLOG$_STD_PROGRAMOFSTUDY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PROCEDURECODEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PROCEDURECODEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PROCEDURECODEHIS IS 'snapshot log for master table SDSADM.STD_PROCEDURECODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PROCEDURECODEHIS FOR SDSADM.MLOG$_STD_PROCEDURECODEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_PROCEDURECODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PROCEDURECODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PROCEDURECODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PROCEDURECODE IS 'snapshot log for master table SDSADM.STD_PROCEDURECODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PROCEDURECODE FOR SDSADM.MLOG$_STD_PROCEDURECODE;


GRANT SELECT ON SDSADM.MLOG$_STD_PROCEDURECODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PRIMCARETMPURPCO1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PRIMCARETMPURPCO1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PRIMCARETMPURPCO1 IS 'snapshot log for master table SDSADM.STD_PRIMCARETMPURPCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PRIMCARETMPURPCO1 FOR SDSADM.MLOG$_STD_PRIMCARETMPURPCO1;


GRANT SELECT ON SDSADM.MLOG$_STD_PRIMCARETMPURPCO1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PRIMCARETMPURPCO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PRIMCARETMPURPCO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PRIMCARETMPURPCO IS 'snapshot log for master table SDSADM.STD_PRIMCARETMPURPCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PRIMCARETMPURPCO FOR SDSADM.MLOG$_STD_PRIMCARETMPURPCO;


GRANT SELECT ON SDSADM.MLOG$_STD_PRIMCARETMPURPCO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PREFFACSRCDESIGH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PREFFACSRCDESIGH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PREFFACSRCDESIGH IS 'snapshot log for master table SDSADM.STD_PREFFACSRCDESIGHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PREFFACSRCDESIGH FOR SDSADM.MLOG$_STD_PREFFACSRCDESIGH;


GRANT SELECT ON SDSADM.MLOG$_STD_PREFFACSRCDESIGH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PREFFACSRCDESIG CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PREFFACSRCDESIG
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PREFFACSRCDESIG IS 'snapshot log for master table SDSADM.STD_PREFFACSRCDESIG';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PREFFACSRCDESIG FOR SDSADM.MLOG$_STD_PREFFACSRCDESIG;


GRANT SELECT ON SDSADM.MLOG$_STD_PREFFACSRCDESIG TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWPERIODHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWPERIODHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWPERIODHISTORY IS 'snapshot log for master table SDSADM.STD_POWPERIODHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWPERIODHISTORY FOR SDSADM.MLOG$_STD_POWPERIODHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_POWPERIODHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWPERIOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWPERIOD
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWPERIOD IS 'snapshot log for master table SDSADM.STD_POWPERIOD';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWPERIOD FOR SDSADM.MLOG$_STD_POWPERIOD;


GRANT SELECT ON SDSADM.MLOG$_STD_POWPERIOD TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWDOCUMENTTYPEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWDOCUMENTTYPEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWDOCUMENTTYPEH IS 'snapshot log for master table SDSADM.STD_POWDOCUMENTTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWDOCUMENTTYPEH FOR SDSADM.MLOG$_STD_POWDOCUMENTTYPEH;


GRANT SELECT ON SDSADM.MLOG$_STD_POWDOCUMENTTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWDOCUMENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWDOCUMENTTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWDOCUMENTTYPE IS 'snapshot log for master table SDSADM.STD_POWDOCUMENTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWDOCUMENTTYPE FOR SDSADM.MLOG$_STD_POWDOCUMENTTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_POWDOCUMENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWDATASOURCETYP1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWDATASOURCETYP1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWDATASOURCETYP1 IS 'snapshot log for master table SDSADM.STD_POWDATASOURCETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWDATASOURCETYP1 FOR SDSADM.MLOG$_STD_POWDATASOURCETYP1;


GRANT SELECT ON SDSADM.MLOG$_STD_POWDATASOURCETYP1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWDATASOURCETYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWDATASOURCETYP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWDATASOURCETYP IS 'snapshot log for master table SDSADM.STD_POWDATASOURCETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWDATASOURCETYP FOR SDSADM.MLOG$_STD_POWDATASOURCETYP;


GRANT SELECT ON SDSADM.MLOG$_STD_POWDATASOURCETYP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWCONFINELOCNTY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWCONFINELOCNTY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWCONFINELOCNTY1 IS 'snapshot log for master table SDSADM.STD_POWCONFINELOCNTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWCONFINELOCNTY1 FOR SDSADM.MLOG$_STD_POWCONFINELOCNTY1;


GRANT SELECT ON SDSADM.MLOG$_STD_POWCONFINELOCNTY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWCONFINELOCNTY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWCONFINELOCNTY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWCONFINELOCNTY IS 'snapshot log for master table SDSADM.STD_POWCONFINELOCNTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWCONFINELOCNTY FOR SDSADM.MLOG$_STD_POWCONFINELOCNTY;


GRANT SELECT ON SDSADM.MLOG$_STD_POWCONFINELOCNTY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWCASUALTYLOCAT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWCASUALTYLOCAT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWCASUALTYLOCAT IS 'snapshot log for master table SDSADM.STD_POWCASUALTYLOCATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWCASUALTYLOCAT FOR SDSADM.MLOG$_STD_POWCASUALTYLOCAT;


GRANT SELECT ON SDSADM.MLOG$_STD_POWCASUALTYLOCAT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POWCASLOCNHISTOR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POWCASLOCNHISTOR
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POWCASLOCNHISTOR IS 'snapshot log for master table SDSADM.STD_POWCASLOCNHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POWCASLOCNHISTOR FOR SDSADM.MLOG$_STD_POWCASLOCNHISTOR;


GRANT SELECT ON SDSADM.MLOG$_STD_POWCASLOCNHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POLICYHOLDERTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POLICYHOLDERTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POLICYHOLDERTYPE1 IS 'snapshot log for master table SDSADM.STD_POLICYHOLDERTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POLICYHOLDERTYPE1 FOR SDSADM.MLOG$_STD_POLICYHOLDERTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_POLICYHOLDERTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_POLICYHOLDERTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_POLICYHOLDERTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_POLICYHOLDERTYPE IS 'snapshot log for master table SDSADM.STD_POLICYHOLDERTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_POLICYHOLDERTYPE FOR SDSADM.MLOG$_STD_POLICYHOLDERTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_POLICYHOLDERTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PLANCATEGORYTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PLANCATEGORYTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PLANCATEGORYTYPE1 IS 'snapshot log for master table SDSADM.STD_PLANCATEGORYTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PLANCATEGORYTYPE1 FOR SDSADM.MLOG$_STD_PLANCATEGORYTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_PLANCATEGORYTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PLANCATEGORYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PLANCATEGORYTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PLANCATEGORYTYPE IS 'snapshot log for master table SDSADM.STD_PLANCATEGORYTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PLANCATEGORYTYPE FOR SDSADM.MLOG$_STD_PLANCATEGORYTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_PLANCATEGORYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PLACEOFADMISSION1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PLACEOFADMISSION1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PLACEOFADMISSION1 IS 'snapshot log for master table SDSADM.STD_PLACEOFADMISSIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PLACEOFADMISSION1 FOR SDSADM.MLOG$_STD_PLACEOFADMISSION1;


GRANT SELECT ON SDSADM.MLOG$_STD_PLACEOFADMISSION1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PLACEOFADMISSION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PLACEOFADMISSION
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PLACEOFADMISSION IS 'snapshot log for master table SDSADM.STD_PLACEOFADMISSION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PLACEOFADMISSION FOR SDSADM.MLOG$_STD_PLACEOFADMISSION;


GRANT SELECT ON SDSADM.MLOG$_STD_PLACEOFADMISSION TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PHONECONTACTTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PHONECONTACTTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PHONECONTACTTYPE1 IS 'snapshot log for master table SDSADM.STD_PHONECONTACTTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PHONECONTACTTYPE1 FOR SDSADM.MLOG$_STD_PHONECONTACTTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_PHONECONTACTTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PHONECONTACTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PHONECONTACTTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PHONECONTACTTYPE IS 'snapshot log for master table SDSADM.STD_PHONECONTACTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PHONECONTACTTYPE FOR SDSADM.MLOG$_STD_PHONECONTACTTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_PHONECONTACTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PHONECHANGESOURC1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PHONECHANGESOURC1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PHONECHANGESOURC1 IS 'snapshot log for master table SDSADM.STD_PHONECHANGESOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PHONECHANGESOURC1 FOR SDSADM.MLOG$_STD_PHONECHANGESOURC1;


GRANT SELECT ON SDSADM.MLOG$_STD_PHONECHANGESOURC1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PHONECHANGESOURC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PHONECHANGESOURC
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PHONECHANGESOURC IS 'snapshot log for master table SDSADM.STD_PHONECHANGESOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PHONECHANGESOURC FOR SDSADM.MLOG$_STD_PHONECHANGESOURC;


GRANT SELECT ON SDSADM.MLOG$_STD_PHONECHANGESOURC TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PHDATASRCTYPEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PHDATASRCTYPEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PHDATASRCTYPEHIS IS 'snapshot log for master table SDSADM.STD_PHDATASRCTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PHDATASRCTYPEHIS FOR SDSADM.MLOG$_STD_PHDATASRCTYPEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_PHDATASRCTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PHDATASRCTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PHDATASRCTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PHDATASRCTYPE IS 'snapshot log for master table SDSADM.STD_PHDATASRCTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PHDATASRCTYPE FOR SDSADM.MLOG$_STD_PHDATASRCTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_PHDATASRCTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONRELATIONHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONRELATIONHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONRELATIONHI IS 'snapshot log for master table SDSADM.STD_PERSONRELATIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONRELATIONHI FOR SDSADM.MLOG$_STD_PERSONRELATIONHI;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONRELATIONHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONRELATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONRELATION
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONRELATION IS 'snapshot log for master table SDSADM.STD_PERSONRELATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONRELATION FOR SDSADM.MLOG$_STD_PERSONRELATION;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONRELATION TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONMERGESTATU1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONMERGESTATU1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONMERGESTATU1 IS 'snapshot log for master table SDSADM.STD_PERSONMERGESTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONMERGESTATU1 FOR SDSADM.MLOG$_STD_PERSONMERGESTATU1;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONMERGESTATU1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONMERGESTATU CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONMERGESTATU
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONMERGESTATU IS 'snapshot log for master table SDSADM.STD_PERSONMERGESTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONMERGESTATU FOR SDSADM.MLOG$_STD_PERSONMERGESTATU;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONMERGESTATU TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCONTACTTYP1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCONTACTTYP1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCONTACTTYP1 IS 'snapshot log for master table SDSADM.STD_PERSONCONTACTTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCONTACTTYP1 FOR SDSADM.MLOG$_STD_PERSONCONTACTTYP1;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCONTACTTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCONTACTTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCONTACTTYP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCONTACTTYP IS 'snapshot log for master table SDSADM.STD_PERSONCONTACTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCONTACTTYP FOR SDSADM.MLOG$_STD_PERSONCONTACTTYP;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCONTACTTYP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCLASSPTHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCLASSPTHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCLASSPTHIS IS 'snapshot log for master table SDSADM.STD_PERSONCLASSPTHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCLASSPTHIS FOR SDSADM.MLOG$_STD_PERSONCLASSPTHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCLASSPTHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCLASSPROVI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCLASSPROVI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCLASSPROVI IS 'snapshot log for master table SDSADM.STD_PERSONCLASSPROVIDERTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCLASSPROVI FOR SDSADM.MLOG$_STD_PERSONCLASSPROVI;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCLASSPROVI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCLASSHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCLASSHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCLASSHISTO IS 'snapshot log for master table SDSADM.STD_PERSONCLASSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCLASSHISTO FOR SDSADM.MLOG$_STD_PERSONCLASSHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCLASSHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCLASSCLASS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCLASSCLASS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCLASSCLASS IS 'snapshot log for master table SDSADM.STD_PERSONCLASSCLASSIFICATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCLASSCLASS FOR SDSADM.MLOG$_STD_PERSONCLASSCLASS;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCLASSCLASS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCLASSCHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCLASSCHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCLASSCHIST IS 'snapshot log for master table SDSADM.STD_PERSONCLASSCHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCLASSCHIST FOR SDSADM.MLOG$_STD_PERSONCLASSCHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCLASSCHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCLASS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCLASS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCLASS IS 'snapshot log for master table SDSADM.STD_PERSONCLASS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCLASS FOR SDSADM.MLOG$_STD_PERSONCLASS;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCLASS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCATEGORYHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCATEGORYHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCATEGORYHI IS 'snapshot log for master table SDSADM.STD_PERSONCATEGORYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCATEGORYHI FOR SDSADM.MLOG$_STD_PERSONCATEGORYHI;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCATEGORYHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERSONCATEGORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERSONCATEGORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERSONCATEGORY IS 'snapshot log for master table SDSADM.STD_PERSONCATEGORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERSONCATEGORY FOR SDSADM.MLOG$_STD_PERSONCATEGORY;


GRANT SELECT ON SDSADM.MLOG$_STD_PERSONCATEGORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERMANENTCODEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERMANENTCODEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERMANENTCODEHIS IS 'snapshot log for master table SDSADM.STD_PERMANENTCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERMANENTCODEHIS FOR SDSADM.MLOG$_STD_PERMANENTCODEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_PERMANENTCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERMANENTCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERMANENTCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERMANENTCODE IS 'snapshot log for master table SDSADM.STD_PERMANENTCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERMANENTCODE FOR SDSADM.MLOG$_STD_PERMANENTCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_PERMANENTCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERIODOFSERVICEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERIODOFSERVICEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERIODOFSERVICEH IS 'snapshot log for master table SDSADM.STD_PERIODOFSERVICEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERIODOFSERVICEH FOR SDSADM.MLOG$_STD_PERIODOFSERVICEH;


GRANT SELECT ON SDSADM.MLOG$_STD_PERIODOFSERVICEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PERIODOFSERVICE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PERIODOFSERVICE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PERIODOFSERVICE IS 'snapshot log for master table SDSADM.STD_PERIODOFSERVICE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PERIODOFSERVICE FOR SDSADM.MLOG$_STD_PERIODOFSERVICE;


GRANT SELECT ON SDSADM.MLOG$_STD_PERIODOFSERVICE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PATIENTTYPEHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PATIENTTYPEHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PATIENTTYPEHISTO IS 'snapshot log for master table SDSADM.STD_PATIENTTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PATIENTTYPEHISTO FOR SDSADM.MLOG$_STD_PATIENTTYPEHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_PATIENTTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_PATIENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_PATIENTTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_PATIENTTYPE IS 'snapshot log for master table SDSADM.STD_PATIENTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_PATIENTTYPE FOR SDSADM.MLOG$_STD_PATIENTTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_PATIENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_OTHERFEDERALAGEN1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_OTHERFEDERALAGEN1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_OTHERFEDERALAGEN1 IS 'snapshot log for master table SDSADM.STD_OTHERFEDERALAGENCYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_OTHERFEDERALAGEN1 FOR SDSADM.MLOG$_STD_OTHERFEDERALAGEN1;


GRANT SELECT ON SDSADM.MLOG$_STD_OTHERFEDERALAGEN1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_OTHERFEDERALAGEN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_OTHERFEDERALAGEN
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_OTHERFEDERALAGEN IS 'snapshot log for master table SDSADM.STD_OTHERFEDERALAGENCY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_OTHERFEDERALAGEN FOR SDSADM.MLOG$_STD_OTHERFEDERALAGEN;


GRANT SELECT ON SDSADM.MLOG$_STD_OTHERFEDERALAGEN TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ORGPROVTAXONOMYH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ORGPROVTAXONOMYH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ORGPROVTAXONOMYH IS 'snapshot log for master table SDSADM.STD_ORGPROVTAXONOMYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ORGPROVTAXONOMYH FOR SDSADM.MLOG$_STD_ORGPROVTAXONOMYH;


GRANT SELECT ON SDSADM.MLOG$_STD_ORGPROVTAXONOMYH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ORGPROVTAXONOMY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ORGPROVTAXONOMY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ORGPROVTAXONOMY IS 'snapshot log for master table SDSADM.STD_ORGPROVTAXONOMY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ORGPROVTAXONOMY FOR SDSADM.MLOG$_STD_ORGPROVTAXONOMY;


GRANT SELECT ON SDSADM.MLOG$_STD_ORGPROVTAXONOMY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_OEFOIFSOURCEHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_OEFOIFSOURCEHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_OEFOIFSOURCEHIST IS 'snapshot log for master table SDSADM.STD_OEFOIFSOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_OEFOIFSOURCEHIST FOR SDSADM.MLOG$_STD_OEFOIFSOURCEHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_OEFOIFSOURCEHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_OEFOIFSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_OEFOIFSOURCE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_OEFOIFSOURCE IS 'snapshot log for master table SDSADM.STD_OEFOIFSOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_OEFOIFSOURCE FOR SDSADM.MLOG$_STD_OEFOIFSOURCE;


GRANT SELECT ON SDSADM.MLOG$_STD_OEFOIFSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NTRVERIFICATNMTH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NTRVERIFICATNMTH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NTRVERIFICATNMTH IS 'snapshot log for master table SDSADM.STD_NTRVERIFICATNMTHDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NTRVERIFICATNMTH FOR SDSADM.MLOG$_STD_NTRVERIFICATNMTH;


GRANT SELECT ON SDSADM.MLOG$_STD_NTRVERIFICATNMTH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NTRVERIFICATIONM CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NTRVERIFICATIONM
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NTRVERIFICATIONM IS 'snapshot log for master table SDSADM.STD_NTRVERIFICATIONMETHOD';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NTRVERIFICATIONM FOR SDSADM.MLOG$_STD_NTRVERIFICATIONM;


GRANT SELECT ON SDSADM.MLOG$_STD_NTRVERIFICATIONM TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NTRQUALIFIERHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NTRQUALIFIERHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NTRQUALIFIERHIST IS 'snapshot log for master table SDSADM.STD_NTRQUALIFIERHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NTRQUALIFIERHIST FOR SDSADM.MLOG$_STD_NTRQUALIFIERHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_NTRQUALIFIERHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NTRQUALIFIER CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NTRQUALIFIER
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NTRQUALIFIER IS 'snapshot log for master table SDSADM.STD_NTRQUALIFIER';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NTRQUALIFIER FOR SDSADM.MLOG$_STD_NTRQUALIFIER;


GRANT SELECT ON SDSADM.MLOG$_STD_NTRQUALIFIER TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NPPESORGALTRSNHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NPPESORGALTRSNHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NPPESORGALTRSNHI IS 'snapshot log for master table SDSADM.STD_NPPESORGALTRSNHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NPPESORGALTRSNHI FOR SDSADM.MLOG$_STD_NPPESORGALTRSNHI;


GRANT SELECT ON SDSADM.MLOG$_STD_NPPESORGALTRSNHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NPPESORGALTRSN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NPPESORGALTRSN
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NPPESORGALTRSN IS 'snapshot log for master table SDSADM.STD_NPPESORGALTRSN';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NPPESORGALTRSN FOR SDSADM.MLOG$_STD_NPPESORGALTRSN;


GRANT SELECT ON SDSADM.MLOG$_STD_NPPESORGALTRSN TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NPPESORGALTIDHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NPPESORGALTIDHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NPPESORGALTIDHIS IS 'snapshot log for master table SDSADM.STD_NPPESORGALTIDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NPPESORGALTIDHIS FOR SDSADM.MLOG$_STD_NPPESORGALTIDHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_NPPESORGALTIDHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NPPESORGALTID CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NPPESORGALTID
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NPPESORGALTID IS 'snapshot log for master table SDSADM.STD_NPPESORGALTID';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NPPESORGALTID FOR SDSADM.MLOG$_STD_NPPESORGALTID;


GRANT SELECT ON SDSADM.MLOG$_STD_NPPESORGALTID TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NPPESORGALIASTYP1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NPPESORGALIASTYP1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NPPESORGALIASTYP1 IS 'snapshot log for master table SDSADM.STD_NPPESORGALIASTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NPPESORGALIASTYP1 FOR SDSADM.MLOG$_STD_NPPESORGALIASTYP1;


GRANT SELECT ON SDSADM.MLOG$_STD_NPPESORGALIASTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NPPESORGALIASTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NPPESORGALIASTYP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NPPESORGALIASTYP IS 'snapshot log for master table SDSADM.STD_NPPESORGALIASTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NPPESORGALIASTYP FOR SDSADM.MLOG$_STD_NPPESORGALIASTYP;


GRANT SELECT ON SDSADM.MLOG$_STD_NPPESORGALIASTYP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NOSITEUPLOADREAS1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NOSITEUPLOADREAS1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NOSITEUPLOADREAS1 IS 'snapshot log for master table SDSADM.STD_NOSITEUPLOADREASONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NOSITEUPLOADREAS1 FOR SDSADM.MLOG$_STD_NOSITEUPLOADREAS1;


GRANT SELECT ON SDSADM.MLOG$_STD_NOSITEUPLOADREAS1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NOSITEUPLOADREAS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NOSITEUPLOADREAS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NOSITEUPLOADREAS IS 'snapshot log for master table SDSADM.STD_NOSITEUPLOADREASON';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NOSITEUPLOADREAS FOR SDSADM.MLOG$_STD_NOSITEUPLOADREAS;


GRANT SELECT ON SDSADM.MLOG$_STD_NOSITEUPLOADREAS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NAMETYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NAMETYPEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NAMETYPEHISTORY IS 'snapshot log for master table SDSADM.STD_NAMETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NAMETYPEHISTORY FOR SDSADM.MLOG$_STD_NAMETYPEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_NAMETYPEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NAMETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NAMETYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NAMETYPE IS 'snapshot log for master table SDSADM.STD_NAMETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NAMETYPE FOR SDSADM.MLOG$_STD_NAMETYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_NAMETYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NAMEDCONTINGENCY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NAMEDCONTINGENCY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NAMEDCONTINGENCY1 IS 'snapshot log for master table SDSADM.STD_NAMEDCONTINGENCY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NAMEDCONTINGENCY1 FOR SDSADM.MLOG$_STD_NAMEDCONTINGENCY1;


GRANT SELECT ON SDSADM.MLOG$_STD_NAMEDCONTINGENCY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_NAMEDCONTINGENCY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_NAMEDCONTINGENCY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_NAMEDCONTINGENCY IS 'snapshot log for master table SDSADM.STD_NAMEDCONTINGENCYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_NAMEDCONTINGENCY FOR SDSADM.MLOG$_STD_NAMEDCONTINGENCY;


GRANT SELECT ON SDSADM.MLOG$_STD_NAMEDCONTINGENCY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MTNOTREQRSNTYPEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MTNOTREQRSNTYPEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MTNOTREQRSNTYPEH IS 'snapshot log for master table SDSADM.STD_MTNOTREQRSNTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MTNOTREQRSNTYPEH FOR SDSADM.MLOG$_STD_MTNOTREQRSNTYPEH;


GRANT SELECT ON SDSADM.MLOG$_STD_MTNOTREQRSNTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MTNOTREQRSNTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MTNOTREQRSNTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MTNOTREQRSNTYPE IS 'snapshot log for master table SDSADM.STD_MTNOTREQRSNTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MTNOTREQRSNTYPE FOR SDSADM.MLOG$_STD_MTNOTREQRSNTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_MTNOTREQRSNTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MSTSTATUSHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MSTSTATUSHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MSTSTATUSHISTORY IS 'snapshot log for master table SDSADM.STD_MSTSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MSTSTATUSHISTORY FOR SDSADM.MLOG$_STD_MSTSTATUSHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_MSTSTATUSHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MSTSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MSTSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MSTSTATUS IS 'snapshot log for master table SDSADM.STD_MSTSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MSTSTATUS FOR SDSADM.MLOG$_STD_MSTSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_MSTSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MSDSCOUNTRYHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MSDSCOUNTRYHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MSDSCOUNTRYHISTO IS 'snapshot log for master table SDSADM.STD_MSDSCOUNTRYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MSDSCOUNTRYHISTO FOR SDSADM.MLOG$_STD_MSDSCOUNTRYHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_MSDSCOUNTRYHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MSDSCOUNTRY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MSDSCOUNTRY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MSDSCOUNTRY IS 'snapshot log for master table SDSADM.STD_MSDSCOUNTRY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MSDSCOUNTRY FOR SDSADM.MLOG$_STD_MSDSCOUNTRY;


GRANT SELECT ON SDSADM.MLOG$_STD_MSDSCOUNTRY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MONETARYBENEFITT1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MONETARYBENEFITT1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MONETARYBENEFITT1 IS 'snapshot log for master table SDSADM.STD_MONETARYBENEFITTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MONETARYBENEFITT1 FOR SDSADM.MLOG$_STD_MONETARYBENEFITT1;


GRANT SELECT ON SDSADM.MLOG$_STD_MONETARYBENEFITT1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MONETARYBENEFITT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MONETARYBENEFITT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MONETARYBENEFITT IS 'snapshot log for master table SDSADM.STD_MONETARYBENEFITTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MONETARYBENEFITT FOR SDSADM.MLOG$_STD_MONETARYBENEFITT;


GRANT SELECT ON SDSADM.MLOG$_STD_MONETARYBENEFITT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MILITARYSVCQRYST1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MILITARYSVCQRYST1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MILITARYSVCQRYST1 IS 'snapshot log for master table SDSADM.STD_MILITARYSVCQRYSTAT';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MILITARYSVCQRYST1 FOR SDSADM.MLOG$_STD_MILITARYSVCQRYST1;


GRANT SELECT ON SDSADM.MLOG$_STD_MILITARYSVCQRYST1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MILITARYSVCQRYST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MILITARYSVCQRYST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MILITARYSVCQRYST IS 'snapshot log for master table SDSADM.STD_MILITARYSVCQRYSTATHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MILITARYSVCQRYST FOR SDSADM.MLOG$_STD_MILITARYSVCQRYST;


GRANT SELECT ON SDSADM.MLOG$_STD_MILITARYSVCQRYST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MILITARYSVCCOMPH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MILITARYSVCCOMPH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MILITARYSVCCOMPH IS 'snapshot log for master table SDSADM.STD_MILITARYSVCCOMPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MILITARYSVCCOMPH FOR SDSADM.MLOG$_STD_MILITARYSVCCOMPH;


GRANT SELECT ON SDSADM.MLOG$_STD_MILITARYSVCCOMPH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MILITARYSVCCOMP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MILITARYSVCCOMP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MILITARYSVCCOMP IS 'snapshot log for master table SDSADM.STD_MILITARYSVCCOMP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MILITARYSVCCOMP FOR SDSADM.MLOG$_STD_MILITARYSVCCOMP;


GRANT SELECT ON SDSADM.MLOG$_STD_MILITARYSVCCOMP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MILHISTORYTYPEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MILHISTORYTYPEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MILHISTORYTYPEHI IS 'snapshot log for master table SDSADM.STD_MILHISTORYTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MILHISTORYTYPEHI FOR SDSADM.MLOG$_STD_MILHISTORYTYPEHI;


GRANT SELECT ON SDSADM.MLOG$_STD_MILHISTORYTYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MILHISTORYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MILHISTORYTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MILHISTORYTYPE IS 'snapshot log for master table SDSADM.STD_MILHISTORYTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MILHISTORYTYPE FOR SDSADM.MLOG$_STD_MILHISTORYTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_MILHISTORYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MHDATASOURCEHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MHDATASOURCEHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MHDATASOURCEHIST IS 'snapshot log for master table SDSADM.STD_MHDATASOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MHDATASOURCEHIST FOR SDSADM.MLOG$_STD_MHDATASOURCEHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_MHDATASOURCEHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MHDATASOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MHDATASOURCE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MHDATASOURCE IS 'snapshot log for master table SDSADM.STD_MHDATASOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MHDATASOURCE FOR SDSADM.MLOG$_STD_MHDATASOURCE;


GRANT SELECT ON SDSADM.MLOG$_STD_MHDATASOURCE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MESSAGETYPEHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MESSAGETYPEHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MESSAGETYPEHISTO IS 'snapshot log for master table SDSADM.STD_MESSAGETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MESSAGETYPEHISTO FOR SDSADM.MLOG$_STD_MESSAGETYPEHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_MESSAGETYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MESSAGETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MESSAGETYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MESSAGETYPE IS 'snapshot log for master table SDSADM.STD_MESSAGETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MESSAGETYPE FOR SDSADM.MLOG$_STD_MESSAGETYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_MESSAGETYPE TO SDS_ADMIN;

GRANT SELECT ON SDSADM.MLOG$_STD_MESSAGETYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MESSAGESTATUSHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MESSAGESTATUSHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MESSAGESTATUSHIS IS 'snapshot log for master table SDSADM.STD_MESSAGESTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MESSAGESTATUSHIS FOR SDSADM.MLOG$_STD_MESSAGESTATUSHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_MESSAGESTATUSHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MESSAGESTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MESSAGESTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MESSAGESTATUS IS 'snapshot log for master table SDSADM.STD_MESSAGESTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MESSAGESTATUS FOR SDSADM.MLOG$_STD_MESSAGESTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_MESSAGESTATUS TO SDS_ADMIN;

GRANT SELECT ON SDSADM.MLOG$_STD_MESSAGESTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MEANSTESTSTATUSH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MEANSTESTSTATUSH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MEANSTESTSTATUSH IS 'snapshot log for master table SDSADM.STD_MEANSTESTSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MEANSTESTSTATUSH FOR SDSADM.MLOG$_STD_MEANSTESTSTATUSH;


GRANT SELECT ON SDSADM.MLOG$_STD_MEANSTESTSTATUSH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MEANSTESTSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MEANSTESTSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MEANSTESTSTATUS IS 'snapshot log for master table SDSADM.STD_MEANSTESTSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MEANSTESTSTATUS FOR SDSADM.MLOG$_STD_MEANSTESTSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_MEANSTESTSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MEANSTESTSIGSTAT1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MEANSTESTSIGSTAT1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MEANSTESTSIGSTAT1 IS 'snapshot log for master table SDSADM.STD_MEANSTESTSIGSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MEANSTESTSIGSTAT1 FOR SDSADM.MLOG$_STD_MEANSTESTSIGSTAT1;


GRANT SELECT ON SDSADM.MLOG$_STD_MEANSTESTSIGSTAT1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MEANSTESTSIGSTAT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MEANSTESTSIGSTAT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MEANSTESTSIGSTAT IS 'snapshot log for master table SDSADM.STD_MEANSTESTSIGSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MEANSTESTSIGSTAT FOR SDSADM.MLOG$_STD_MEANSTESTSIGSTAT;


GRANT SELECT ON SDSADM.MLOG$_STD_MEANSTESTSIGSTAT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MASMTTHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MASMTTHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MASMTTHISTORY IS 'snapshot log for master table SDSADM.STD_MASMTTHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MASMTTHISTORY FOR SDSADM.MLOG$_STD_MASMTTHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_MASMTTHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MASMOVEMENTTRANS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MASMOVEMENTTRANS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MASMOVEMENTTRANS IS 'snapshot log for master table SDSADM.STD_MASMOVEMENTTRANSACTIONTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MASMOVEMENTTRANS FOR SDSADM.MLOG$_STD_MASMOVEMENTTRANS;


GRANT SELECT ON SDSADM.MLOG$_STD_MASMOVEMENTTRANS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MARITALSTATUSHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MARITALSTATUSHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MARITALSTATUSHIS IS 'snapshot log for master table SDSADM.STD_MARITALSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MARITALSTATUSHIS FOR SDSADM.MLOG$_STD_MARITALSTATUSHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_MARITALSTATUSHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_MARITALSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_MARITALSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_MARITALSTATUS IS 'snapshot log for master table SDSADM.STD_MARITALSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_MARITALSTATUS FOR SDSADM.MLOG$_STD_MARITALSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_MARITALSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_LOCATIONTYPEHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_LOCATIONTYPEHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_LOCATIONTYPEHIST IS 'snapshot log for master table SDSADM.STD_LOCATIONTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_LOCATIONTYPEHIST FOR SDSADM.MLOG$_STD_LOCATIONTYPEHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_LOCATIONTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_LOCATIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_LOCATIONTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_LOCATIONTYPE IS 'snapshot log for master table SDSADM.STD_LOCATIONTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_LOCATIONTYPE FOR SDSADM.MLOG$_STD_LOCATIONTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_LOCATIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IVMUNITHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IVMUNITHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IVMUNITHISTORY IS 'snapshot log for master table SDSADM.STD_IVMUNITHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IVMUNITHISTORY FOR SDSADM.MLOG$_STD_IVMUNITHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_IVMUNITHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IVMUNIT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IVMUNIT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IVMUNIT IS 'snapshot log for master table SDSADM.STD_IVMUNIT';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IVMUNIT FOR SDSADM.MLOG$_STD_IVMUNIT;


GRANT SELECT ON SDSADM.MLOG$_STD_IVMUNIT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IVMMIGRATETYPEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IVMMIGRATETYPEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IVMMIGRATETYPEHI IS 'snapshot log for master table SDSADM.STD_IVMMIGRATETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IVMMIGRATETYPEHI FOR SDSADM.MLOG$_STD_IVMMIGRATETYPEHI;


GRANT SELECT ON SDSADM.MLOG$_STD_IVMMIGRATETYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IVMMIGRATETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IVMMIGRATETYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IVMMIGRATETYPE IS 'snapshot log for master table SDSADM.STD_IVMMIGRATETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IVMMIGRATETYPE FOR SDSADM.MLOG$_STD_IVMMIGRATETYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_IVMMIGRATETYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IVMDECISIONTYPEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IVMDECISIONTYPEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IVMDECISIONTYPEH IS 'snapshot log for master table SDSADM.STD_IVMDECISIONTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IVMDECISIONTYPEH FOR SDSADM.MLOG$_STD_IVMDECISIONTYPEH;


GRANT SELECT ON SDSADM.MLOG$_STD_IVMDECISIONTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IVMDECISIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IVMDECISIONTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IVMDECISIONTYPE IS 'snapshot log for master table SDSADM.STD_IVMDECISIONTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IVMDECISIONTYPE FOR SDSADM.MLOG$_STD_IVMDECISIONTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_IVMDECISIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IVMCASEPRIORCRIT1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IVMCASEPRIORCRIT1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IVMCASEPRIORCRIT1 IS 'snapshot log for master table SDSADM.STD_IVMCASEPRIORCRITHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IVMCASEPRIORCRIT1 FOR SDSADM.MLOG$_STD_IVMCASEPRIORCRIT1;


GRANT SELECT ON SDSADM.MLOG$_STD_IVMCASEPRIORCRIT1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IVMCASEPRIORCRIT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IVMCASEPRIORCRIT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IVMCASEPRIORCRIT IS 'snapshot log for master table SDSADM.STD_IVMCASEPRIORCRIT';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IVMCASEPRIORCRIT FOR SDSADM.MLOG$_STD_IVMCASEPRIORCRIT;


GRANT SELECT ON SDSADM.MLOG$_STD_IVMCASEPRIORCRIT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSURANCETYPEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSURANCETYPEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSURANCETYPEHIS IS 'snapshot log for master table SDSADM.STD_INSURANCETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSURANCETYPEHIS FOR SDSADM.MLOG$_STD_INSURANCETYPEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_INSURANCETYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSURANCETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSURANCETYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSURANCETYPE IS 'snapshot log for master table SDSADM.STD_INSURANCETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSURANCETYPE FOR SDSADM.MLOG$_STD_INSURANCETYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_INSURANCETYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSURANCEREPORTS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSURANCEREPORTS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSURANCEREPORTS IS 'snapshot log for master table SDSADM.STD_INSURANCEREPORTSOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSURANCEREPORTS FOR SDSADM.MLOG$_STD_INSURANCEREPORTS;


GRANT SELECT ON SDSADM.MLOG$_STD_INSURANCEREPORTS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSURANCEPLANTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSURANCEPLANTYP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSURANCEPLANTYP IS 'snapshot log for master table SDSADM.STD_INSURANCEPLANTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSURANCEPLANTYP FOR SDSADM.MLOG$_STD_INSURANCEPLANTYP;


GRANT SELECT ON SDSADM.MLOG$_STD_INSURANCEPLANTYP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSURANCEMAPPING1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSURANCEMAPPING1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSURANCEMAPPING1 IS 'snapshot log for master table SDSADM.STD_INSURANCEMAPPINGHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSURANCEMAPPING1 FOR SDSADM.MLOG$_STD_INSURANCEMAPPING1;


GRANT SELECT ON SDSADM.MLOG$_STD_INSURANCEMAPPING1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSURANCEMAPPING CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSURANCEMAPPING
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSURANCEMAPPING IS 'snapshot log for master table SDSADM.STD_INSURANCEMAPPING';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSURANCEMAPPING FOR SDSADM.MLOG$_STD_INSURANCEMAPPING;


GRANT SELECT ON SDSADM.MLOG$_STD_INSURANCEMAPPING TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSURANCEHOLDERT1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSURANCEHOLDERT1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSURANCEHOLDERT1 IS 'snapshot log for master table SDSADM.STD_INSURANCEHOLDERTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSURANCEHOLDERT1 FOR SDSADM.MLOG$_STD_INSURANCEHOLDERT1;


GRANT SELECT ON SDSADM.MLOG$_STD_INSURANCEHOLDERT1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSURANCEHOLDERT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSURANCEHOLDERT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSURANCEHOLDERT IS 'snapshot log for master table SDSADM.STD_INSURANCEHOLDERTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSURANCEHOLDERT FOR SDSADM.MLOG$_STD_INSURANCEHOLDERT;


GRANT SELECT ON SDSADM.MLOG$_STD_INSURANCEHOLDERT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSTITUTIONCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSTITUTIONCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSTITUTIONCODE IS 'snapshot log for master table SDSADM.STD_INSTITUTIONCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSTITUTIONCODE FOR SDSADM.MLOG$_STD_INSTITUTIONCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_INSTITUTIONCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSTITUTION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSTITUTION
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSTITUTION IS 'snapshot log for master table SDSADM.STD_INSTITUTION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSTITUTION FOR SDSADM.MLOG$_STD_INSTITUTION;


GRANT SELECT ON SDSADM.MLOG$_STD_INSTITUTION TO SDS_ADMIN;

GRANT SELECT ON SDSADM.MLOG$_STD_INSTITUTION TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSRPRTSRCHISTOR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSRPRTSRCHISTOR
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSRPRTSRCHISTOR IS 'snapshot log for master table SDSADM.STD_INSRPRTSRCHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSRPRTSRCHISTOR FOR SDSADM.MLOG$_STD_INSRPRTSRCHISTOR;


GRANT SELECT ON SDSADM.MLOG$_STD_INSRPRTSRCHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INSPLANTYPEHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INSPLANTYPEHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INSPLANTYPEHISTO IS 'snapshot log for master table SDSADM.STD_INSPLANTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INSPLANTYPEHISTO FOR SDSADM.MLOG$_STD_INSPLANTYPEHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_INSPLANTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMEVERIFSTATU1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMEVERIFSTATU1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMEVERIFSTATU1 IS 'snapshot log for master table SDSADM.STD_INCOMEVERIFSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMEVERIFSTATU1 FOR SDSADM.MLOG$_STD_INCOMEVERIFSTATU1;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMEVERIFSTATU1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMEVERIFSTATU CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMEVERIFSTATU
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMEVERIFSTATU IS 'snapshot log for master table SDSADM.STD_INCOMEVERIFSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMEVERIFSTATU FOR SDSADM.MLOG$_STD_INCOMEVERIFSTATU;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMEVERIFSTATU TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMETYPEHISTOR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMETYPEHISTOR
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMETYPEHISTOR IS 'snapshot log for master table SDSADM.STD_INCOMETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMETYPEHISTOR FOR SDSADM.MLOG$_STD_INCOMETYPEHISTOR;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMETYPEHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMETYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMETYPE IS 'snapshot log for master table SDSADM.STD_INCOMETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMETYPE FOR SDSADM.MLOG$_STD_INCOMETYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMETYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMETHRESHOLDH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMETHRESHOLDH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMETHRESHOLDH IS 'snapshot log for master table SDSADM.STD_INCOMETHRESHOLDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMETHRESHOLDH FOR SDSADM.MLOG$_STD_INCOMETHRESHOLDH;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMETHRESHOLDH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMETHRESHOLD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMETHRESHOLD
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMETHRESHOLD IS 'snapshot log for master table SDSADM.STD_INCOMETHRESHOLD';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMETHRESHOLD FOR SDSADM.MLOG$_STD_INCOMETHRESHOLD;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMETHRESHOLD TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMETESTTYPEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMETESTTYPEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMETESTTYPEHI IS 'snapshot log for master table SDSADM.STD_INCOMETESTTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMETESTTYPEHI FOR SDSADM.MLOG$_STD_INCOMETESTTYPEHI;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMETESTTYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMETESTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMETESTTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMETESTTYPE IS 'snapshot log for master table SDSADM.STD_INCOMETESTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMETESTTYPE FOR SDSADM.MLOG$_STD_INCOMETESTTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMETESTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMETESTSOURCE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMETESTSOURCE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMETESTSOURCE1 IS 'snapshot log for master table SDSADM.STD_INCOMETESTSOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMETESTSOURCE1 FOR SDSADM.MLOG$_STD_INCOMETESTSOURCE1;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMETESTSOURCE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_INCOMETESTSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_INCOMETESTSOURCE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_INCOMETESTSOURCE IS 'snapshot log for master table SDSADM.STD_INCOMETESTSOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_INCOMETESTSOURCE FOR SDSADM.MLOG$_STD_INCOMETESTSOURCE;


GRANT SELECT ON SDSADM.MLOG$_STD_INCOMETESTSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDTASKSTATUSTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDTASKSTATUSTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDTASKSTATUSTYPE1 IS 'snapshot log for master table SDSADM.STD_IDTASKSTATUSTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDTASKSTATUSTYPE1 FOR SDSADM.MLOG$_STD_IDTASKSTATUSTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_IDTASKSTATUSTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDTASKSTATUSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDTASKSTATUSTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDTASKSTATUSTYPE IS 'snapshot log for master table SDSADM.STD_IDTASKSTATUSTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDTASKSTATUSTYPE FOR SDSADM.MLOG$_STD_IDTASKSTATUSTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_IDTASKSTATUSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDTASKPROBCATEGO1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDTASKPROBCATEGO1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDTASKPROBCATEGO1 IS 'snapshot log for master table SDSADM.STD_IDTASKPROBCATEGORYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDTASKPROBCATEGO1 FOR SDSADM.MLOG$_STD_IDTASKPROBCATEGO1;


GRANT SELECT ON SDSADM.MLOG$_STD_IDTASKPROBCATEGO1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDTASKPROBCATEGO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDTASKPROBCATEGO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDTASKPROBCATEGO IS 'snapshot log for master table SDSADM.STD_IDTASKPROBCATEGORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDTASKPROBCATEGO FOR SDSADM.MLOG$_STD_IDTASKPROBCATEGO;


GRANT SELECT ON SDSADM.MLOG$_STD_IDTASKPROBCATEGO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP1 IS 'snapshot log for master table SDSADM.STD_IDEXCEPTYPEGROUPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDEXCEPTYPEGROUP1 FOR SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP1;


GRANT SELECT ON SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP IS 'snapshot log for master table SDSADM.STD_IDEXCEPTYPEGROUP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDEXCEPTYPEGROUP FOR SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP;


GRANT SELECT ON SDSADM.MLOG$_STD_IDEXCEPTYPEGROUP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDEVENTTYPEHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDEVENTTYPEHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDEVENTTYPEHISTO IS 'snapshot log for master table SDSADM.STD_IDEVENTTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDEVENTTYPEHISTO FOR SDSADM.MLOG$_STD_IDEVENTTYPEHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_IDEVENTTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDEVENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDEVENTTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDEVENTTYPE IS 'snapshot log for master table SDSADM.STD_IDEVENTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDEVENTTYPE FOR SDSADM.MLOG$_STD_IDEVENTTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_IDEVENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDENTIFIERTYPEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDENTIFIERTYPEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDENTIFIERTYPEHI IS 'snapshot log for master table SDSADM.STD_IDENTIFIERTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDENTIFIERTYPEHI FOR SDSADM.MLOG$_STD_IDENTIFIERTYPEHI;


GRANT SELECT ON SDSADM.MLOG$_STD_IDENTIFIERTYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_IDENTIFIERTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_IDENTIFIERTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_IDENTIFIERTYPE IS 'snapshot log for master table SDSADM.STD_IDENTIFIERTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_IDENTIFIERTYPE FOR SDSADM.MLOG$_STD_IDENTIFIERTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_IDENTIFIERTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7WHATSUBJECTFL1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7WHATSUBJECTFL1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7WHATSUBJECTFL1 IS 'snapshot log for master table SDSADM.STD_HL7WHATSUBJECTFLTRHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7WHATSUBJECTFL1 FOR SDSADM.MLOG$_STD_HL7WHATSUBJECTFL1;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7WHATSUBJECTFL1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7WHATSUBJECTFL CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7WHATSUBJECTFL
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7WHATSUBJECTFL IS 'snapshot log for master table SDSADM.STD_HL7WHATSUBJECTFLTR';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7WHATSUBJECTFL FOR SDSADM.MLOG$_STD_HL7WHATSUBJECTFL;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7WHATSUBJECTFL TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7VERSIONIDHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7VERSIONIDHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7VERSIONIDHIST IS 'snapshot log for master table SDSADM.STD_HL7VERSIONIDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7VERSIONIDHIST FOR SDSADM.MLOG$_STD_HL7VERSIONIDHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7VERSIONIDHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7VERSIONID CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7VERSIONID
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7VERSIONID IS 'snapshot log for master table SDSADM.STD_HL7VERSIONID';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7VERSIONID FOR SDSADM.MLOG$_STD_HL7VERSIONID;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7VERSIONID TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7VALUETYPEHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7VALUETYPEHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7VALUETYPEHIST IS 'snapshot log for master table SDSADM.STD_HL7VALUETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7VALUETYPEHIST FOR SDSADM.MLOG$_STD_HL7VALUETYPEHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7VALUETYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7VALUETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7VALUETYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7VALUETYPE IS 'snapshot log for master table SDSADM.STD_HL7VALUETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7VALUETYPE FOR SDSADM.MLOG$_STD_HL7VALUETYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7VALUETYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7SRCOFCOMMENTH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7SRCOFCOMMENTH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7SRCOFCOMMENTH IS 'snapshot log for master table SDSADM.STD_HL7SRCOFCOMMENTHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7SRCOFCOMMENTH FOR SDSADM.MLOG$_STD_HL7SRCOFCOMMENTH;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7SRCOFCOMMENTH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7SRCOFCOMMENT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7SRCOFCOMMENT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7SRCOFCOMMENT IS 'snapshot log for master table SDSADM.STD_HL7SRCOFCOMMENT';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7SRCOFCOMMENT FOR SDSADM.MLOG$_STD_HL7SRCOFCOMMENT;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7SRCOFCOMMENT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7RESPMODALITYH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7RESPMODALITYH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7RESPMODALITYH IS 'snapshot log for master table SDSADM.STD_HL7RESPMODALITYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7RESPMODALITYH FOR SDSADM.MLOG$_STD_HL7RESPMODALITYH;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7RESPMODALITYH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7RESPMODALITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7RESPMODALITY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7RESPMODALITY IS 'snapshot log for master table SDSADM.STD_HL7RESPMODALITY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7RESPMODALITY FOR SDSADM.MLOG$_STD_HL7RESPMODALITY;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7RESPMODALITY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7RESPLEVCODEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7RESPLEVCODEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7RESPLEVCODEHI IS 'snapshot log for master table SDSADM.STD_HL7RESPLEVCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7RESPLEVCODEHI FOR SDSADM.MLOG$_STD_HL7RESPLEVCODEHI;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7RESPLEVCODEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7RESPLEVCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7RESPLEVCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7RESPLEVCODE IS 'snapshot log for master table SDSADM.STD_HL7RESPLEVCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7RESPLEVCODE FOR SDSADM.MLOG$_STD_HL7RESPLEVCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7RESPLEVCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7RECLEVEVCODEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7RECLEVEVCODEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7RECLEVEVCODEH IS 'snapshot log for master table SDSADM.STD_HL7RECLEVEVCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7RECLEVEVCODEH FOR SDSADM.MLOG$_STD_HL7RECLEVEVCODEH;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7RECLEVEVCODEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7RECLEVEVCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7RECLEVEVCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7RECLEVEVCODE IS 'snapshot log for master table SDSADM.STD_HL7RECLEVEVCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7RECLEVEVCODE FOR SDSADM.MLOG$_STD_HL7RECLEVEVCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7RECLEVEVCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7RECLEVERRRETH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7RECLEVERRRETH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7RECLEVERRRETH IS 'snapshot log for master table SDSADM.STD_HL7RECLEVERRRETHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7RECLEVERRRETH FOR SDSADM.MLOG$_STD_HL7RECLEVERRRETH;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7RECLEVERRRETH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7RECLEVERRRET CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7RECLEVERRRET
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7RECLEVERRRET IS 'snapshot log for master table SDSADM.STD_HL7RECLEVERRRET';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7RECLEVERRRET FOR SDSADM.MLOG$_STD_HL7RECLEVERRRET;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7RECLEVERRRET TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QUERYRESULTSH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QUERYRESULTSH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QUERYRESULTSH IS 'snapshot log for master table SDSADM.STD_HL7QUERYRESULTSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QUERYRESULTSH FOR SDSADM.MLOG$_STD_HL7QUERYRESULTSH;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QUERYRESULTSH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QUERYRESULTS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QUERYRESULTS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QUERYRESULTS IS 'snapshot log for master table SDSADM.STD_HL7QUERYRESULTS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QUERYRESULTS FOR SDSADM.MLOG$_STD_HL7QUERYRESULTS;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QUERYRESULTS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QUERYRESPONSE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QUERYRESPONSE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QUERYRESPONSE IS 'snapshot log for master table SDSADM.STD_HL7QUERYRESPONSESTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QUERYRESPONSE FOR SDSADM.MLOG$_STD_HL7QUERYRESPONSE;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QUERYRESPONSE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QUERYPRIORITY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QUERYPRIORITY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QUERYPRIORITY1 IS 'snapshot log for master table SDSADM.STD_HL7QUERYPRIORITYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QUERYPRIORITY1 FOR SDSADM.MLOG$_STD_HL7QUERYPRIORITY1;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QUERYPRIORITY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QUERYPRIORITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QUERYPRIORITY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QUERYPRIORITY IS 'snapshot log for master table SDSADM.STD_HL7QUERYPRIORITY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QUERYPRIORITY FOR SDSADM.MLOG$_STD_HL7QUERYPRIORITY;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QUERYPRIORITY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QUANTITYLIMIT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QUANTITYLIMIT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QUANTITYLIMIT IS 'snapshot log for master table SDSADM.STD_HL7QUANTITYLIMITEDREQUEST';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QUANTITYLIMIT FOR SDSADM.MLOG$_STD_HL7QUANTITYLIMIT;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QUANTITYLIMIT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QUANLIMREQHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QUANLIMREQHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QUANLIMREQHIS IS 'snapshot log for master table SDSADM.STD_HL7QUANLIMREQHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QUANLIMREQHIS FOR SDSADM.MLOG$_STD_HL7QUANLIMREQHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QUANLIMREQHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QRYRESPSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QRYRESPSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QRYRESPSTATUS IS 'snapshot log for master table SDSADM.STD_HL7QRYRESPSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QRYRESPSTATUS FOR SDSADM.MLOG$_STD_HL7QRYRESPSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QRYRESPSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD1 IS 'snapshot log for master table SDSADM.STD_HL7QRYRESPFMTCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QRYRESPFMTCOD1 FOR SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD1;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD IS 'snapshot log for master table SDSADM.STD_HL7QRYRESPFMTCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7QRYRESPFMTCOD FOR SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7QRYRESPFMTCOD TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7PROCMODEHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7PROCMODEHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7PROCMODEHISTO IS 'snapshot log for master table SDSADM.STD_HL7PROCMODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7PROCMODEHISTO FOR SDSADM.MLOG$_STD_HL7PROCMODEHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7PROCMODEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7PROCIDHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7PROCIDHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7PROCIDHISTORY IS 'snapshot log for master table SDSADM.STD_HL7PROCIDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7PROCIDHISTORY FOR SDSADM.MLOG$_STD_HL7PROCIDHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7PROCIDHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7PROCESSINGMOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7PROCESSINGMOD
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7PROCESSINGMOD IS 'snapshot log for master table SDSADM.STD_HL7PROCESSINGMODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7PROCESSINGMOD FOR SDSADM.MLOG$_STD_HL7PROCESSINGMOD;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7PROCESSINGMOD TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7PROCESSINGID CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7PROCESSINGID
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7PROCESSINGID IS 'snapshot log for master table SDSADM.STD_HL7PROCESSINGID';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7PROCESSINGID FOR SDSADM.MLOG$_STD_HL7PROCESSINGID;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7PROCESSINGID TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7PRIMKEYVALTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7PRIMKEYVALTYP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7PRIMKEYVALTYP IS 'snapshot log for master table SDSADM.STD_HL7PRIMKEYVALTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7PRIMKEYVALTYP FOR SDSADM.MLOG$_STD_HL7PRIMKEYVALTYP;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7PRIMKEYVALTYP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7PRIMARYKEYVAL CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7PRIMARYKEYVAL
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7PRIMARYKEYVAL IS 'snapshot log for master table SDSADM.STD_HL7PRIMARYKEYVALUETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7PRIMARYKEYVAL FOR SDSADM.MLOG$_STD_HL7PRIMARYKEYVAL;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7PRIMARYKEYVAL TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7OBSERVRESULTC1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7OBSERVRESULTC1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7OBSERVRESULTC1 IS 'snapshot log for master table SDSADM.STD_HL7OBSERVRESULTCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7OBSERVRESULTC1 FOR SDSADM.MLOG$_STD_HL7OBSERVRESULTC1;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7OBSERVRESULTC1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7OBSERVRESULTC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7OBSERVRESULTC
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7OBSERVRESULTC IS 'snapshot log for master table SDSADM.STD_HL7OBSERVRESULTCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7OBSERVRESULTC FOR SDSADM.MLOG$_STD_HL7OBSERVRESULTC;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7OBSERVRESULTC TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7MESSAGETYPEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7MESSAGETYPEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7MESSAGETYPEHI IS 'snapshot log for master table SDSADM.STD_HL7MESSAGETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7MESSAGETYPEHI FOR SDSADM.MLOG$_STD_HL7MESSAGETYPEHI;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7MESSAGETYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7MESSAGETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7MESSAGETYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7MESSAGETYPE IS 'snapshot log for master table SDSADM.STD_HL7MESSAGETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7MESSAGETYPE FOR SDSADM.MLOG$_STD_HL7MESSAGETYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7MESSAGETYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7MESSAGESTRUCH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7MESSAGESTRUCH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7MESSAGESTRUCH IS 'snapshot log for master table SDSADM.STD_HL7MESSAGESTRUCHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7MESSAGESTRUCH FOR SDSADM.MLOG$_STD_HL7MESSAGESTRUCH;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7MESSAGESTRUCH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7MESSAGESTRUC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7MESSAGESTRUC
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7MESSAGESTRUC IS 'snapshot log for master table SDSADM.STD_HL7MESSAGESTRUC';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7MESSAGESTRUC FOR SDSADM.MLOG$_STD_HL7MESSAGESTRUC;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7MESSAGESTRUC TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7MASTERFILEIDC1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7MASTERFILEIDC1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7MASTERFILEIDC1 IS 'snapshot log for master table SDSADM.STD_HL7MASTERFILEIDCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7MASTERFILEIDC1 FOR SDSADM.MLOG$_STD_HL7MASTERFILEIDC1;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7MASTERFILEIDC1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7MASTERFILEIDC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7MASTERFILEIDC
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7MASTERFILEIDC IS 'snapshot log for master table SDSADM.STD_HL7MASTERFILEIDCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7MASTERFILEIDC FOR SDSADM.MLOG$_STD_HL7MASTERFILEIDC;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7MASTERFILEIDC TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7FILELEVELEVEN1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7FILELEVELEVEN1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7FILELEVELEVEN1 IS 'snapshot log for master table SDSADM.STD_HL7FILELEVELEVENTHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7FILELEVELEVEN1 FOR SDSADM.MLOG$_STD_HL7FILELEVELEVEN1;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7FILELEVELEVEN1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7FILELEVELEVEN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7FILELEVELEVEN
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7FILELEVELEVEN IS 'snapshot log for master table SDSADM.STD_HL7FILELEVELEVENT';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7FILELEVELEVEN FOR SDSADM.MLOG$_STD_HL7FILELEVELEVEN;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7FILELEVELEVEN TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7EVENTTYPEHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7EVENTTYPEHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7EVENTTYPEHIST IS 'snapshot log for master table SDSADM.STD_HL7EVENTTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7EVENTTYPEHIST FOR SDSADM.MLOG$_STD_HL7EVENTTYPEHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7EVENTTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7EVENTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7EVENTTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7EVENTTYPE IS 'snapshot log for master table SDSADM.STD_HL7EVENTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7EVENTTYPE FOR SDSADM.MLOG$_STD_HL7EVENTTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7EVENTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7DATATYPEHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7DATATYPEHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7DATATYPEHISTO IS 'snapshot log for master table SDSADM.STD_HL7DATATYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7DATATYPEHISTO FOR SDSADM.MLOG$_STD_HL7DATATYPEHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7DATATYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7DATATYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7DATATYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7DATATYPE IS 'snapshot log for master table SDSADM.STD_HL7DATATYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7DATATYPE FOR SDSADM.MLOG$_STD_HL7DATATYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7DATATYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7ACTIONCODEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7ACTIONCODEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7ACTIONCODEHIS IS 'snapshot log for master table SDSADM.STD_HL7ACTIONCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7ACTIONCODEHIS FOR SDSADM.MLOG$_STD_HL7ACTIONCODEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7ACTIONCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7ACTIONCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7ACTIONCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7ACTIONCODE IS 'snapshot log for master table SDSADM.STD_HL7ACTIONCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7ACTIONCODE FOR SDSADM.MLOG$_STD_HL7ACTIONCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7ACTIONCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7ACKTYPEHISTOR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7ACKTYPEHISTOR
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7ACKTYPEHISTOR IS 'snapshot log for master table SDSADM.STD_HL7ACKTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7ACKTYPEHISTOR FOR SDSADM.MLOG$_STD_HL7ACKTYPEHISTOR;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7ACKTYPEHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME1 IS 'snapshot log for master table SDSADM.STD_HL7ACKNOWLEDGEMENTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7ACKNOWLEDGEME1 FOR SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME1;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME IS 'snapshot log for master table SDSADM.STD_HL7ACKNOWLEDGEMENTCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7ACKNOWLEDGEME FOR SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME TO SDS_ADMIN;

GRANT SELECT ON SDSADM.MLOG$_STD_HL7ACKNOWLEDGEME TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL7ACKCODEHISTOR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL7ACKCODEHISTOR
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL7ACKCODEHISTOR IS 'snapshot log for master table SDSADM.STD_HL7ACKCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL7ACKCODEHISTOR FOR SDSADM.MLOG$_STD_HL7ACKCODEHISTOR;


GRANT SELECT ON SDSADM.MLOG$_STD_HL7ACKCODEHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL724RACEMAPHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL724RACEMAPHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL724RACEMAPHIST IS 'snapshot log for master table SDSADM.STD_HL724RACEMAPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL724RACEMAPHIST FOR SDSADM.MLOG$_STD_HL724RACEMAPHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_HL724RACEMAPHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL724RACEMAP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL724RACEMAP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL724RACEMAP IS 'snapshot log for master table SDSADM.STD_HL724RACEMAP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL724RACEMAP FOR SDSADM.MLOG$_STD_HL724RACEMAP;


GRANT SELECT ON SDSADM.MLOG$_STD_HL724RACEMAP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL724MARITALSTAM1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL724MARITALSTAM1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL724MARITALSTAM1 IS 'snapshot log for master table SDSADM.STD_HL724MARITALSTAMAPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL724MARITALSTAM1 FOR SDSADM.MLOG$_STD_HL724MARITALSTAM1;


GRANT SELECT ON SDSADM.MLOG$_STD_HL724MARITALSTAM1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL724MARITALSTAM CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL724MARITALSTAM
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL724MARITALSTAM IS 'snapshot log for master table SDSADM.STD_HL724MARITALSTAMAP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL724MARITALSTAM FOR SDSADM.MLOG$_STD_HL724MARITALSTAM;


GRANT SELECT ON SDSADM.MLOG$_STD_HL724MARITALSTAM TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL724ETHNICITYMA1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL724ETHNICITYMA1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL724ETHNICITYMA1 IS 'snapshot log for master table SDSADM.STD_HL724ETHNICITYMAPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL724ETHNICITYMA1 FOR SDSADM.MLOG$_STD_HL724ETHNICITYMA1;


GRANT SELECT ON SDSADM.MLOG$_STD_HL724ETHNICITYMA1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HL724ETHNICITYMA CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HL724ETHNICITYMA
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HL724ETHNICITYMA IS 'snapshot log for master table SDSADM.STD_HL724ETHNICITYMAP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HL724ETHNICITYMA FOR SDSADM.MLOG$_STD_HL724ETHNICITYMA;


GRANT SELECT ON SDSADM.MLOG$_STD_HL724ETHNICITYMA TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HEALTHBENEFITTYP1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HEALTHBENEFITTYP1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HEALTHBENEFITTYP1 IS 'snapshot log for master table SDSADM.STD_HEALTHBENEFITTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HEALTHBENEFITTYP1 FOR SDSADM.MLOG$_STD_HEALTHBENEFITTYP1;


GRANT SELECT ON SDSADM.MLOG$_STD_HEALTHBENEFITTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HEALTHBENEFITTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HEALTHBENEFITTYP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HEALTHBENEFITTYP IS 'snapshot log for master table SDSADM.STD_HEALTHBENEFITTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HEALTHBENEFITTYP FOR SDSADM.MLOG$_STD_HEALTHBENEFITTYP;


GRANT SELECT ON SDSADM.MLOG$_STD_HEALTHBENEFITTYP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HEALTHBENEFITPLA1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HEALTHBENEFITPLA1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HEALTHBENEFITPLA1 IS 'snapshot log for master table SDSADM.STD_HEALTHBENEFITPLANHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HEALTHBENEFITPLA1 FOR SDSADM.MLOG$_STD_HEALTHBENEFITPLA1;


GRANT SELECT ON SDSADM.MLOG$_STD_HEALTHBENEFITPLA1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_HEALTHBENEFITPLA CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_HEALTHBENEFITPLA
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_HEALTHBENEFITPLA IS 'snapshot log for master table SDSADM.STD_HEALTHBENEFITPLAN';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_HEALTHBENEFITPLA FOR SDSADM.MLOG$_STD_HEALTHBENEFITPLA;


GRANT SELECT ON SDSADM.MLOG$_STD_HEALTHBENEFITPLA TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_GMTTHRESHOLDS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_GMTTHRESHOLDS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_GMTTHRESHOLDS IS 'snapshot log for master table SDSADM.STD_GMTTHRESHOLDS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_GMTTHRESHOLDS FOR SDSADM.MLOG$_STD_GMTTHRESHOLDS;


GRANT SELECT ON SDSADM.MLOG$_STD_GMTTHRESHOLDS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_GENDERHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_GENDERHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_GENDERHISTORY IS 'snapshot log for master table SDSADM.STD_GENDERHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_GENDERHISTORY FOR SDSADM.MLOG$_STD_GENDERHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_GENDERHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_GENDER CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_GENDER
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_GENDER IS 'snapshot log for master table SDSADM.STD_GENDER';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_GENDER FOR SDSADM.MLOG$_STD_GENDER;


GRANT SELECT ON SDSADM.MLOG$_STD_GENDER TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FTITRANSTYPEHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FTITRANSTYPEHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FTITRANSTYPEHIST IS 'snapshot log for master table SDSADM.STD_FTITRANSTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FTITRANSTYPEHIST FOR SDSADM.MLOG$_STD_FTITRANSTYPEHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_FTITRANSTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FTITRANSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FTITRANSTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FTITRANSTYPE IS 'snapshot log for master table SDSADM.STD_FTITRANSTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FTITRANSTYPE FOR SDSADM.MLOG$_STD_FTITRANSTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_FTITRANSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FTITRANSSTATUSHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FTITRANSSTATUSHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FTITRANSSTATUSHI IS 'snapshot log for master table SDSADM.STD_FTITRANSSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FTITRANSSTATUSHI FOR SDSADM.MLOG$_STD_FTITRANSSTATUSHI;


GRANT SELECT ON SDSADM.MLOG$_STD_FTITRANSSTATUSHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FTITRANSSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FTITRANSSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FTITRANSSTATUS IS 'snapshot log for master table SDSADM.STD_FTITRANSSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FTITRANSSTATUS FOR SDSADM.MLOG$_STD_FTITRANSSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_FTITRANSSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FINANINFOSOURCEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FINANINFOSOURCEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FINANINFOSOURCEH IS 'snapshot log for master table SDSADM.STD_FINANINFOSOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FINANINFOSOURCEH FOR SDSADM.MLOG$_STD_FINANINFOSOURCEH;


GRANT SELECT ON SDSADM.MLOG$_STD_FINANINFOSOURCEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FINANINFOSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FINANINFOSOURCE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FINANINFOSOURCE IS 'snapshot log for master table SDSADM.STD_FINANINFOSOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FINANINFOSOURCE FOR SDSADM.MLOG$_STD_FINANINFOSOURCE;


GRANT SELECT ON SDSADM.MLOG$_STD_FINANINFOSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FINANCIALMAPPING1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FINANCIALMAPPING1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FINANCIALMAPPING1 IS 'snapshot log for master table SDSADM.STD_FINANCIALMAPPINGHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FINANCIALMAPPING1 FOR SDSADM.MLOG$_STD_FINANCIALMAPPING1;


GRANT SELECT ON SDSADM.MLOG$_STD_FINANCIALMAPPING1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FINANCIALMAPPING CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FINANCIALMAPPING
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FINANCIALMAPPING IS 'snapshot log for master table SDSADM.STD_FINANCIALMAPPING';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FINANCIALMAPPING FOR SDSADM.MLOG$_STD_FINANCIALMAPPING;


GRANT SELECT ON SDSADM.MLOG$_STD_FINANCIALMAPPING TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FINANCIALDOCUMTY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FINANCIALDOCUMTY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FINANCIALDOCUMTY1 IS 'snapshot log for master table SDSADM.STD_FINANCIALDOCUMTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FINANCIALDOCUMTY1 FOR SDSADM.MLOG$_STD_FINANCIALDOCUMTY1;


GRANT SELECT ON SDSADM.MLOG$_STD_FINANCIALDOCUMTY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FINANCIALDOCUMTY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FINANCIALDOCUMTY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FINANCIALDOCUMTY IS 'snapshot log for master table SDSADM.STD_FINANCIALDOCUMTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FINANCIALDOCUMTY FOR SDSADM.MLOG$_STD_FINANCIALDOCUMTY;


GRANT SELECT ON SDSADM.MLOG$_STD_FINANCIALDOCUMTY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FILIPINOVETPROOF CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FILIPINOVETPROOF
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FILIPINOVETPROOF IS 'snapshot log for master table SDSADM.STD_FILIPINOVETPROOFHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FILIPINOVETPROOF FOR SDSADM.MLOG$_STD_FILIPINOVETPROOF;


GRANT SELECT ON SDSADM.MLOG$_STD_FILIPINOVETPROOF TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FILIPINOVETERANP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FILIPINOVETERANP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FILIPINOVETERANP IS 'snapshot log for master table SDSADM.STD_FILIPINOVETERANPROOF';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FILIPINOVETERANP FOR SDSADM.MLOG$_STD_FILIPINOVETERANP;


GRANT SELECT ON SDSADM.MLOG$_STD_FILIPINOVETERANP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FEEBASISTRTMNTHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FEEBASISTRTMNTHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FEEBASISTRTMNTHI IS 'snapshot log for master table SDSADM.STD_FEEBASISTRTMNTHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FEEBASISTRTMNTHI FOR SDSADM.MLOG$_STD_FEEBASISTRTMNTHI;


GRANT SELECT ON SDSADM.MLOG$_STD_FEEBASISTRTMNTHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FEEBASISTREATMEN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FEEBASISTREATMEN
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FEEBASISTREATMEN IS 'snapshot log for master table SDSADM.STD_FEEBASISTREATMENTCODETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FEEBASISTREATMEN FOR SDSADM.MLOG$_STD_FEEBASISTREATMEN;


GRANT SELECT ON SDSADM.MLOG$_STD_FEEBASISTREATMEN TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FEEBASISPROGRAM CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FEEBASISPROGRAM
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FEEBASISPROGRAM IS 'snapshot log for master table SDSADM.STD_FEEBASISPROGRAM';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FEEBASISPROGRAM FOR SDSADM.MLOG$_STD_FEEBASISPROGRAM;


GRANT SELECT ON SDSADM.MLOG$_STD_FEEBASISPROGRAM TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FEEBASISPRGRMHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FEEBASISPRGRMHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FEEBASISPRGRMHIS IS 'snapshot log for master table SDSADM.STD_FEEBASISPRGRMHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FEEBASISPRGRMHIS FOR SDSADM.MLOG$_STD_FEEBASISPRGRMHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_FEEBASISPRGRMHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FACILITYTYPEHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FACILITYTYPEHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FACILITYTYPEHIST IS 'snapshot log for master table SDSADM.STD_FACILITYTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FACILITYTYPEHIST FOR SDSADM.MLOG$_STD_FACILITYTYPEHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_FACILITYTYPEHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_FACILITYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_FACILITYTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_FACILITYTYPE IS 'snapshot log for master table SDSADM.STD_FACILITYTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_FACILITYTYPE FOR SDSADM.MLOG$_STD_FACILITYTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_FACILITYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EXTREMITYCODEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EXTREMITYCODEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EXTREMITYCODEHIS IS 'snapshot log for master table SDSADM.STD_EXTREMITYCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EXTREMITYCODEHIS FOR SDSADM.MLOG$_STD_EXTREMITYCODEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_EXTREMITYCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EXTREMITYCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EXTREMITYCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EXTREMITYCODE IS 'snapshot log for master table SDSADM.STD_EXTREMITYCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EXTREMITYCODE FOR SDSADM.MLOG$_STD_EXTREMITYCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_EXTREMITYCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EXPENSETYPEHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EXPENSETYPEHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EXPENSETYPEHISTO IS 'snapshot log for master table SDSADM.STD_EXPENSETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EXPENSETYPEHISTO FOR SDSADM.MLOG$_STD_EXPENSETYPEHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_EXPENSETYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EXPENSETYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EXPENSETYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EXPENSETYPE IS 'snapshot log for master table SDSADM.STD_EXPENSETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EXPENSETYPE FOR SDSADM.MLOG$_STD_EXPENSETYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_EXPENSETYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE1 IS 'snapshot log for master table SDSADM.STD_EXCLUSIONRSNTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EXCLUSIONRSNTYPE1 FOR SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE IS 'snapshot log for master table SDSADM.STD_EXCLUSIONRSNTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EXCLUSIONRSNTYPE FOR SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_EXCLUSIONRSNTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EVALUATIONMETHOD1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EVALUATIONMETHOD1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EVALUATIONMETHOD1 IS 'snapshot log for master table SDSADM.STD_EVALUATIONMETHODHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EVALUATIONMETHOD1 FOR SDSADM.MLOG$_STD_EVALUATIONMETHOD1;


GRANT SELECT ON SDSADM.MLOG$_STD_EVALUATIONMETHOD1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EVALUATIONMETHOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EVALUATIONMETHOD
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EVALUATIONMETHOD IS 'snapshot log for master table SDSADM.STD_EVALUATIONMETHOD';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EVALUATIONMETHOD FOR SDSADM.MLOG$_STD_EVALUATIONMETHOD;


GRANT SELECT ON SDSADM.MLOG$_STD_EVALUATIONMETHOD TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ETHNICITYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ETHNICITYHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ETHNICITYHISTORY IS 'snapshot log for master table SDSADM.STD_ETHNICITYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ETHNICITYHISTORY FOR SDSADM.MLOG$_STD_ETHNICITYHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_ETHNICITYHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ETHNICITYCOLLECT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ETHNICITYCOLLECT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ETHNICITYCOLLECT IS 'snapshot log for master table SDSADM.STD_ETHNICITYCOLLECTIONMETHOD';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ETHNICITYCOLLECT FOR SDSADM.MLOG$_STD_ETHNICITYCOLLECT;


GRANT SELECT ON SDSADM.MLOG$_STD_ETHNICITYCOLLECT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ETHNICITY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ETHNICITY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ETHNICITY IS 'snapshot log for master table SDSADM.STD_ETHNICITY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ETHNICITY FOR SDSADM.MLOG$_STD_ETHNICITY;


GRANT SELECT ON SDSADM.MLOG$_STD_ETHNICITY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ETHCOLLMTHDHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ETHCOLLMTHDHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ETHCOLLMTHDHISTO IS 'snapshot log for master table SDSADM.STD_ETHCOLLMTHDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ETHCOLLMTHDHISTO FOR SDSADM.MLOG$_STD_ETHCOLLMTHDHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_ETHCOLLMTHDHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENTITLEMENTCODEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENTITLEMENTCODEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENTITLEMENTCODEH IS 'snapshot log for master table SDSADM.STD_ENTITLEMENTCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENTITLEMENTCODEH FOR SDSADM.MLOG$_STD_ENTITLEMENTCODEH;


GRANT SELECT ON SDSADM.MLOG$_STD_ENTITLEMENTCODEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENTITLEMENTCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENTITLEMENTCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENTITLEMENTCODE IS 'snapshot log for master table SDSADM.STD_ENTITLEMENTCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENTITLEMENTCODE FOR SDSADM.MLOG$_STD_ENTITLEMENTCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_ENTITLEMENTCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTSTATUS1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTSTATUS1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTSTATUS1 IS 'snapshot log for master table SDSADM.STD_ENROLLMENTSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTSTATUS1 FOR SDSADM.MLOG$_STD_ENROLLMENTSTATUS1;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTSTATUS IS 'snapshot log for master table SDSADM.STD_ENROLLMENTSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTSTATUS FOR SDSADM.MLOG$_STD_ENROLLMENTSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTSOURCE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTSOURCE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTSOURCE1 IS 'snapshot log for master table SDSADM.STD_ENROLLMENTSOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTSOURCE1 FOR SDSADM.MLOG$_STD_ENROLLMENTSOURCE1;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTSOURCE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTSOURCE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTSOURCE IS 'snapshot log for master table SDSADM.STD_ENROLLMENTSOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTSOURCE FOR SDSADM.MLOG$_STD_ENROLLMENTSOURCE;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORS1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORS1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORS1 IS 'snapshot log for master table SDSADM.STD_ENROLLMENTPRIORSGRPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTPRIORS1 FOR SDSADM.MLOG$_STD_ENROLLMENTPRIORS1;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTPRIORS1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORS IS 'snapshot log for master table SDSADM.STD_ENROLLMENTPRIORSGRP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTPRIORS FOR SDSADM.MLOG$_STD_ENROLLMENTPRIORS;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTPRIORS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORG1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORG1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORG1 IS 'snapshot log for master table SDSADM.STD_ENROLLMENTPRIORGRPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTPRIORG1 FOR SDSADM.MLOG$_STD_ENROLLMENTPRIORG1;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTPRIORG1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORG CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORG
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTPRIORG IS 'snapshot log for master table SDSADM.STD_ENROLLMENTPRIORGRP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTPRIORG FOR SDSADM.MLOG$_STD_ENROLLMENTPRIORG;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTPRIORG TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTOVRDER CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTOVRDER
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTOVRDER IS 'snapshot log for master table SDSADM.STD_ENROLLMENTOVRDERSNHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTOVRDER FOR SDSADM.MLOG$_STD_ENROLLMENTOVRDER;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTOVRDER TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTOVERRI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTOVERRI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTOVERRI IS 'snapshot log for master table SDSADM.STD_ENROLLMENTOVERRIDEREASON';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTOVERRI FOR SDSADM.MLOG$_STD_ENROLLMENTOVERRI;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTOVERRI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTCATTYP1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTCATTYP1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTCATTYP1 IS 'snapshot log for master table SDSADM.STD_ENROLLMENTCATTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTCATTYP1 FOR SDSADM.MLOG$_STD_ENROLLMENTCATTYP1;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTCATTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ENROLLMENTCATTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ENROLLMENTCATTYP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ENROLLMENTCATTYP IS 'snapshot log for master table SDSADM.STD_ENROLLMENTCATTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ENROLLMENTCATTYP FOR SDSADM.MLOG$_STD_ENROLLMENTCATTYP;


GRANT SELECT ON SDSADM.MLOG$_STD_ENROLLMENTCATTYP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMPLOYMENTSTATUS1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMPLOYMENTSTATUS1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMPLOYMENTSTATUS1 IS 'snapshot log for master table SDSADM.STD_EMPLOYMENTSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMPLOYMENTSTATUS1 FOR SDSADM.MLOG$_STD_EMPLOYMENTSTATUS1;


GRANT SELECT ON SDSADM.MLOG$_STD_EMPLOYMENTSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMPLOYMENTSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMPLOYMENTSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMPLOYMENTSTATUS IS 'snapshot log for master table SDSADM.STD_EMPLOYMENTSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMPLOYMENTSTATUS FOR SDSADM.MLOG$_STD_EMPLOYMENTSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_EMPLOYMENTSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMERGENCYRESPONS1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMERGENCYRESPONS1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMERGENCYRESPONS1 IS 'snapshot log for master table SDSADM.STD_EMERGENCYRESPONSEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMERGENCYRESPONS1 FOR SDSADM.MLOG$_STD_EMERGENCYRESPONS1;


GRANT SELECT ON SDSADM.MLOG$_STD_EMERGENCYRESPONS1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMERGENCYRESPONS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMERGENCYRESPONS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMERGENCYRESPONS IS 'snapshot log for master table SDSADM.STD_EMERGENCYRESPONSE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMERGENCYRESPONS FOR SDSADM.MLOG$_STD_EMERGENCYRESPONS;


GRANT SELECT ON SDSADM.MLOG$_STD_EMERGENCYRESPONS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMAIL_DOMAINHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMAIL_DOMAINHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMAIL_DOMAINHIST IS 'snapshot log for master table SDSADM.STD_EMAIL_DOMAINHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMAIL_DOMAINHIST FOR SDSADM.MLOG$_STD_EMAIL_DOMAINHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_EMAIL_DOMAINHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMAIL_DOMAIN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMAIL_DOMAIN
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMAIL_DOMAIN IS 'snapshot log for master table SDSADM.STD_EMAIL_DOMAIN';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMAIL_DOMAIN FOR SDSADM.MLOG$_STD_EMAIL_DOMAIN;


GRANT SELECT ON SDSADM.MLOG$_STD_EMAIL_DOMAIN TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMAILCHANGESOURC1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMAILCHANGESOURC1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMAILCHANGESOURC1 IS 'snapshot log for master table SDSADM.STD_EMAILCHANGESOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMAILCHANGESOURC1 FOR SDSADM.MLOG$_STD_EMAILCHANGESOURC1;


GRANT SELECT ON SDSADM.MLOG$_STD_EMAILCHANGESOURC1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMAILCHANGESOURC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMAILCHANGESOURC
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMAILCHANGESOURC IS 'snapshot log for master table SDSADM.STD_EMAILCHANGESOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMAILCHANGESOURC FOR SDSADM.MLOG$_STD_EMAILCHANGESOURC;


GRANT SELECT ON SDSADM.MLOG$_STD_EMAILCHANGESOURC TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMAILADDRESSTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMAILADDRESSTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMAILADDRESSTYPE1 IS 'snapshot log for master table SDSADM.STD_EMAILADDRESSTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMAILADDRESSTYPE1 FOR SDSADM.MLOG$_STD_EMAILADDRESSTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_EMAILADDRESSTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EMAILADDRESSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EMAILADDRESSTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EMAILADDRESSTYPE IS 'snapshot log for master table SDSADM.STD_EMAILADDRESSTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EMAILADDRESSTYPE FOR SDSADM.MLOG$_STD_EMAILADDRESSTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_EMAILADDRESSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGPRMRYDATASRC CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGPRMRYDATASRC
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGPRMRYDATASRC IS 'snapshot log for master table SDSADM.STD_ELIGPRMRYDATASRCHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGPRMRYDATASRC FOR SDSADM.MLOG$_STD_ELIGPRMRYDATASRC;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGPRMRYDATASRC TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYVRSCT1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYVRSCT1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYVRSCT1 IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYVRSCTYPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYVRSCT1 FOR SDSADM.MLOG$_STD_ELIGIBILITYVRSCT1;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYVRSCT1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYVRSCT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYVRSCT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYVRSCT IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYVRSCTYP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYVRSCT FOR SDSADM.MLOG$_STD_ELIGIBILITYVRSCT;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYVRSCT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYSTATU1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYSTATU1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYSTATU1 IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYSTATU1 FOR SDSADM.MLOG$_STD_ELIGIBILITYSTATU1;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYSTATU1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYSTATU CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYSTATU
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYSTATU IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYSTATU FOR SDSADM.MLOG$_STD_ELIGIBILITYSTATU;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYSTATU TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYPRIMA CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYPRIMA
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYPRIMA IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYPRIMARYDATASRC';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYPRIMA FOR SDSADM.MLOG$_STD_ELIGIBILITYPRIMA;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYPRIMA TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYFACTO1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYFACTO1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYFACTO1 IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYFACTORHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYFACTO1 FOR SDSADM.MLOG$_STD_ELIGIBILITYFACTO1;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYFACTO1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYFACTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYFACTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYFACTO IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYFACTOR';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYFACTO FOR SDSADM.MLOG$_STD_ELIGIBILITYFACTO;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYFACTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODET1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODET1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODET1 IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYCODETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYCODET1 FOR SDSADM.MLOG$_STD_ELIGIBILITYCODET1;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYCODET1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODET CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODET
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODET IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYCODETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYCODET FOR SDSADM.MLOG$_STD_ELIGIBILITYCODET;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYCODET TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODEH IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYCODEH FOR SDSADM.MLOG$_STD_ELIGIBILITYCODEH;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYCODEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGIBILITYCODE IS 'snapshot log for master table SDSADM.STD_ELIGIBILITYCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGIBILITYCODE FOR SDSADM.MLOG$_STD_ELIGIBILITYCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGIBILITYCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGDOCTYPEHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGDOCTYPEHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGDOCTYPEHISTO IS 'snapshot log for master table SDSADM.STD_ELIGDOCTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGDOCTYPEHISTO FOR SDSADM.MLOG$_STD_ELIGDOCTYPEHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGDOCTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELIGDOCTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELIGDOCTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELIGDOCTYPE IS 'snapshot log for master table SDSADM.STD_ELIGDOCTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELIGDOCTYPE FOR SDSADM.MLOG$_STD_ELIGDOCTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_ELIGDOCTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELECTRONICPLANTY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELECTRONICPLANTY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELECTRONICPLANTY1 IS 'snapshot log for master table SDSADM.STD_ELECTRONICPLANTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELECTRONICPLANTY1 FOR SDSADM.MLOG$_STD_ELECTRONICPLANTY1;


GRANT SELECT ON SDSADM.MLOG$_STD_ELECTRONICPLANTY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ELECTRONICPLANTY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ELECTRONICPLANTY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ELECTRONICPLANTY IS 'snapshot log for master table SDSADM.STD_ELECTRONICPLANTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ELECTRONICPLANTY FOR SDSADM.MLOG$_STD_ELECTRONICPLANTY;


GRANT SELECT ON SDSADM.MLOG$_STD_ELECTRONICPLANTY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EGTTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EGTTYPEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EGTTYPEHISTORY IS 'snapshot log for master table SDSADM.STD_EGTTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EGTTYPEHISTORY FOR SDSADM.MLOG$_STD_EGTTYPEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_EGTTYPEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EGTTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EGTTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EGTTYPE IS 'snapshot log for master table SDSADM.STD_EGTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EGTTYPE FOR SDSADM.MLOG$_STD_EGTTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_EGTTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EGTPROCESSSTATUS1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EGTPROCESSSTATUS1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EGTPROCESSSTATUS1 IS 'snapshot log for master table SDSADM.STD_EGTPROCESSSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EGTPROCESSSTATUS1 FOR SDSADM.MLOG$_STD_EGTPROCESSSTATUS1;


GRANT SELECT ON SDSADM.MLOG$_STD_EGTPROCESSSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_EGTPROCESSSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_EGTPROCESSSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_EGTPROCESSSTATUS IS 'snapshot log for master table SDSADM.STD_EGTPROCESSSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_EGTPROCESSSTATUS FOR SDSADM.MLOG$_STD_EGTPROCESSSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_EGTPROCESSSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DOCUMENTSOURCETY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DOCUMENTSOURCETY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DOCUMENTSOURCETY1 IS 'snapshot log for master table SDSADM.STD_DOCUMENTSOURCETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DOCUMENTSOURCETY1 FOR SDSADM.MLOG$_STD_DOCUMENTSOURCETY1;


GRANT SELECT ON SDSADM.MLOG$_STD_DOCUMENTSOURCETY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DOCUMENTSOURCETY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DOCUMENTSOURCETY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DOCUMENTSOURCETY IS 'snapshot log for master table SDSADM.STD_DOCUMENTSOURCETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DOCUMENTSOURCETY FOR SDSADM.MLOG$_STD_DOCUMENTSOURCETY;


GRANT SELECT ON SDSADM.MLOG$_STD_DOCUMENTSOURCETY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DISTRIBUTIONTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DISTRIBUTIONTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DISTRIBUTIONTYPE1 IS 'snapshot log for master table SDSADM.STD_DISTRIBUTIONTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DISTRIBUTIONTYPE1 FOR SDSADM.MLOG$_STD_DISTRIBUTIONTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_DISTRIBUTIONTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DISTRIBUTIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DISTRIBUTIONTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DISTRIBUTIONTYPE IS 'snapshot log for master table SDSADM.STD_DISTRIBUTIONTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DISTRIBUTIONTYPE FOR SDSADM.MLOG$_STD_DISTRIBUTIONTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_DISTRIBUTIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DISTRIBUTIONCODE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DISTRIBUTIONCODE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DISTRIBUTIONCODE1 IS 'snapshot log for master table SDSADM.STD_DISTRIBUTIONCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DISTRIBUTIONCODE1 FOR SDSADM.MLOG$_STD_DISTRIBUTIONCODE1;


GRANT SELECT ON SDSADM.MLOG$_STD_DISTRIBUTIONCODE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DISTRIBUTIONCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DISTRIBUTIONCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DISTRIBUTIONCODE IS 'snapshot log for master table SDSADM.STD_DISTRIBUTIONCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DISTRIBUTIONCODE FOR SDSADM.MLOG$_STD_DISTRIBUTIONCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_DISTRIBUTIONCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DISABILITYCONDIT1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DISABILITYCONDIT1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DISABILITYCONDIT1 IS 'snapshot log for master table SDSADM.STD_DISABILITYCONDITIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DISABILITYCONDIT1 FOR SDSADM.MLOG$_STD_DISABILITYCONDIT1;


GRANT SELECT ON SDSADM.MLOG$_STD_DISABILITYCONDIT1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DISABILITYCONDIT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DISABILITYCONDIT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DISABILITYCONDIT IS 'snapshot log for master table SDSADM.STD_DISABILITYCONDITION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DISABILITYCONDIT FOR SDSADM.MLOG$_STD_DISABILITYCONDIT;


GRANT SELECT ON SDSADM.MLOG$_STD_DISABILITYCONDIT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DIAGNOSISTYPEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DIAGNOSISTYPEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DIAGNOSISTYPEHIS IS 'snapshot log for master table SDSADM.STD_DIAGNOSISTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DIAGNOSISTYPEHIS FOR SDSADM.MLOG$_STD_DIAGNOSISTYPEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_DIAGNOSISTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DIAGNOSISTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DIAGNOSISTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DIAGNOSISTYPE IS 'snapshot log for master table SDSADM.STD_DIAGNOSISTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DIAGNOSISTYPE FOR SDSADM.MLOG$_STD_DIAGNOSISTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_DIAGNOSISTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DIAGNOSISCODSCHH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DIAGNOSISCODSCHH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DIAGNOSISCODSCHH IS 'snapshot log for master table SDSADM.STD_DIAGNOSISCODSCHHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DIAGNOSISCODSCHH FOR SDSADM.MLOG$_STD_DIAGNOSISCODSCHH;


GRANT SELECT ON SDSADM.MLOG$_STD_DIAGNOSISCODSCHH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DIAGNOSISCODSCH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DIAGNOSISCODSCH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DIAGNOSISCODSCH IS 'snapshot log for master table SDSADM.STD_DIAGNOSISCODSCH';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DIAGNOSISCODSCH FOR SDSADM.MLOG$_STD_DIAGNOSISCODSCH;


GRANT SELECT ON SDSADM.MLOG$_STD_DIAGNOSISCODSCH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DIAGNOSISCODEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DIAGNOSISCODEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DIAGNOSISCODEHIS IS 'snapshot log for master table SDSADM.STD_DIAGNOSISCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DIAGNOSISCODEHIS FOR SDSADM.MLOG$_STD_DIAGNOSISCODEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_DIAGNOSISCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DIAGNOSISCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DIAGNOSISCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DIAGNOSISCODE IS 'snapshot log for master table SDSADM.STD_DIAGNOSISCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DIAGNOSISCODE FOR SDSADM.MLOG$_STD_DIAGNOSISCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_DIAGNOSISCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DETAILEDINCOMETY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DETAILEDINCOMETY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DETAILEDINCOMETY1 IS 'snapshot log for master table SDSADM.STD_DETAILEDINCOMETYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DETAILEDINCOMETY1 FOR SDSADM.MLOG$_STD_DETAILEDINCOMETY1;


GRANT SELECT ON SDSADM.MLOG$_STD_DETAILEDINCOMETY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DETAILEDINCOMETY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DETAILEDINCOMETY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DETAILEDINCOMETY IS 'snapshot log for master table SDSADM.STD_DETAILEDINCOMETYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DETAILEDINCOMETY FOR SDSADM.MLOG$_STD_DETAILEDINCOMETY;


GRANT SELECT ON SDSADM.MLOG$_STD_DETAILEDINCOMETY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DETAILEDINCFINDO1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DETAILEDINCFINDO1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DETAILEDINCFINDO1 IS 'snapshot log for master table SDSADM.STD_DETAILEDINCFINDOCHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DETAILEDINCFINDO1 FOR SDSADM.MLOG$_STD_DETAILEDINCFINDO1;


GRANT SELECT ON SDSADM.MLOG$_STD_DETAILEDINCFINDO1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DETAILEDINCFINDO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DETAILEDINCFINDO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DETAILEDINCFINDO IS 'snapshot log for master table SDSADM.STD_DETAILEDINCFINDOC';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DETAILEDINCFINDO FOR SDSADM.MLOG$_STD_DETAILEDINCFINDO;


GRANT SELECT ON SDSADM.MLOG$_STD_DETAILEDINCFINDO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DESCRIPTORCODEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DESCRIPTORCODEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255),
  XID$$            NUMBER
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DESCRIPTORCODEHI IS 'snapshot log for master table SDSADM.STD_DESCRIPTORCODEHISTORY';


CREATE INDEX SDSADM.I_MLOG$_STD_DESCRIPTORCODE1 ON SDSADM.MLOG$_STD_DESCRIPTORCODEHI
(XID$$)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

GRANT SELECT ON SDSADM.MLOG$_STD_DESCRIPTORCODEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DESCRIPTORCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DESCRIPTORCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255),
  XID$$            NUMBER
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DESCRIPTORCODE IS 'snapshot log for master table SDSADM.STD_DESCRIPTORCODE';


CREATE INDEX SDSADM.I_MLOG$_STD_DESCRIPTORCODE ON SDSADM.MLOG$_STD_DESCRIPTORCODE
(XID$$)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

GRANT SELECT ON SDSADM.MLOG$_STD_DESCRIPTORCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DELIVERYSRCTYPEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DELIVERYSRCTYPEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DELIVERYSRCTYPEH IS 'snapshot log for master table SDSADM.STD_DELIVERYSRCTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DELIVERYSRCTYPEH FOR SDSADM.MLOG$_STD_DELIVERYSRCTYPEH;


GRANT SELECT ON SDSADM.MLOG$_STD_DELIVERYSRCTYPEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DELIVERYSRCTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DELIVERYSRCTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DELIVERYSRCTYPE IS 'snapshot log for master table SDSADM.STD_DELIVERYSRCTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DELIVERYSRCTYPE FOR SDSADM.MLOG$_STD_DELIVERYSRCTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_DELIVERYSRCTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DELIVERYPREFTYPH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DELIVERYPREFTYPH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DELIVERYPREFTYPH IS 'snapshot log for master table SDSADM.STD_DELIVERYPREFTYPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DELIVERYPREFTYPH FOR SDSADM.MLOG$_STD_DELIVERYPREFTYPH;


GRANT SELECT ON SDSADM.MLOG$_STD_DELIVERYPREFTYPH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DELIVERYPREFTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DELIVERYPREFTYP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DELIVERYPREFTYP IS 'snapshot log for master table SDSADM.STD_DELIVERYPREFTYP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DELIVERYPREFTYP FOR SDSADM.MLOG$_STD_DELIVERYPREFTYP;


GRANT SELECT ON SDSADM.MLOG$_STD_DELIVERYPREFTYP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DEGREEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DEGREEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DEGREEHISTORY IS 'snapshot log for master table SDSADM.STD_DEGREEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DEGREEHISTORY FOR SDSADM.MLOG$_STD_DEGREEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_DEGREEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DEGREE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DEGREE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DEGREE IS 'snapshot log for master table SDSADM.STD_DEGREE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DEGREE FOR SDSADM.MLOG$_STD_DEGREE;


GRANT SELECT ON SDSADM.MLOG$_STD_DEGREE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DECORATNDOCTYPHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DECORATNDOCTYPHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DECORATNDOCTYPHI IS 'snapshot log for master table SDSADM.STD_DECORATNDOCTYPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DECORATNDOCTYPHI FOR SDSADM.MLOG$_STD_DECORATNDOCTYPHI;


GRANT SELECT ON SDSADM.MLOG$_STD_DECORATNDOCTYPHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DECORATIONTYPEHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DECORATIONTYPEHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DECORATIONTYPEHI IS 'snapshot log for master table SDSADM.STD_DECORATIONTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DECORATIONTYPEHI FOR SDSADM.MLOG$_STD_DECORATIONTYPEHI;


GRANT SELECT ON SDSADM.MLOG$_STD_DECORATIONTYPEHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DECORATIONTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DECORATIONTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DECORATIONTYPE IS 'snapshot log for master table SDSADM.STD_DECORATIONTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DECORATIONTYPE FOR SDSADM.MLOG$_STD_DECORATIONTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_DECORATIONTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DECORATIONSTATUS1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DECORATIONSTATUS1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DECORATIONSTATUS1 IS 'snapshot log for master table SDSADM.STD_DECORATIONSTATUSHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DECORATIONSTATUS1 FOR SDSADM.MLOG$_STD_DECORATIONSTATUS1;


GRANT SELECT ON SDSADM.MLOG$_STD_DECORATIONSTATUS1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DECORATIONSTATUS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DECORATIONSTATUS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DECORATIONSTATUS IS 'snapshot log for master table SDSADM.STD_DECORATIONSTATUS';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DECORATIONSTATUS FOR SDSADM.MLOG$_STD_DECORATIONSTATUS;


GRANT SELECT ON SDSADM.MLOG$_STD_DECORATIONSTATUS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DECORATIONDOCUME CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DECORATIONDOCUME
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DECORATIONDOCUME IS 'snapshot log for master table SDSADM.STD_DECORATIONDOCUMENTTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DECORATIONDOCUME FOR SDSADM.MLOG$_STD_DECORATIONDOCUME;


GRANT SELECT ON SDSADM.MLOG$_STD_DECORATIONDOCUME TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DEATHNOTIFICATIO1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DEATHNOTIFICATIO1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DEATHNOTIFICATIO1 IS 'snapshot log for master table SDSADM.STD_DEATHNOTIFICATIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DEATHNOTIFICATIO1 FOR SDSADM.MLOG$_STD_DEATHNOTIFICATIO1;


GRANT SELECT ON SDSADM.MLOG$_STD_DEATHNOTIFICATIO1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DEATHNOTIFICATIO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DEATHNOTIFICATIO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DEATHNOTIFICATIO IS 'snapshot log for master table SDSADM.STD_DEATHNOTIFICATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DEATHNOTIFICATIO FOR SDSADM.MLOG$_STD_DEATHNOTIFICATIO;


GRANT SELECT ON SDSADM.MLOG$_STD_DEATHNOTIFICATIO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DATACOLLECTJOBTY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DATACOLLECTJOBTY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DATACOLLECTJOBTY1 IS 'snapshot log for master table SDSADM.STD_DATACOLLECTJOBTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DATACOLLECTJOBTY1 FOR SDSADM.MLOG$_STD_DATACOLLECTJOBTY1;


GRANT SELECT ON SDSADM.MLOG$_STD_DATACOLLECTJOBTY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DATACOLLECTJOBTY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DATACOLLECTJOBTY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DATACOLLECTJOBTY IS 'snapshot log for master table SDSADM.STD_DATACOLLECTJOBTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DATACOLLECTJOBTY FOR SDSADM.MLOG$_STD_DATACOLLECTJOBTY;


GRANT SELECT ON SDSADM.MLOG$_STD_DATACOLLECTJOBTY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DATACHANGESOURCE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DATACHANGESOURCE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DATACHANGESOURCE1 IS 'snapshot log for master table SDSADM.STD_DATACHANGESOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DATACHANGESOURCE1 FOR SDSADM.MLOG$_STD_DATACHANGESOURCE1;


GRANT SELECT ON SDSADM.MLOG$_STD_DATACHANGESOURCE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DATACHANGESOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DATACHANGESOURCE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DATACHANGESOURCE IS 'snapshot log for master table SDSADM.STD_DATACHANGESOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DATACHANGESOURCE FOR SDSADM.MLOG$_STD_DATACHANGESOURCE;


GRANT SELECT ON SDSADM.MLOG$_STD_DATACHANGESOURCE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_DATABASEVERSION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_DATABASEVERSION
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_DATABASEVERSION IS 'snapshot log for master table SDSADM.STD_DATABASEVERSION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_DATABASEVERSION FOR SDSADM.MLOG$_STD_DATABASEVERSION;


GRANT SELECT ON SDSADM.MLOG$_STD_DATABASEVERSION TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COUNTYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COUNTYHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COUNTYHISTORY IS 'snapshot log for master table SDSADM.STD_COUNTYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COUNTYHISTORY FOR SDSADM.MLOG$_STD_COUNTYHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_COUNTYHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COUNTY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COUNTY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COUNTY IS 'snapshot log for master table SDSADM.STD_COUNTY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COUNTY FOR SDSADM.MLOG$_STD_COUNTY;


GRANT SELECT ON SDSADM.MLOG$_STD_COUNTY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COUNTRYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COUNTRYHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COUNTRYHISTORY IS 'snapshot log for master table SDSADM.STD_COUNTRYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COUNTRYHISTORY FOR SDSADM.MLOG$_STD_COUNTRYHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_COUNTRYHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COUNTRY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COUNTRY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COUNTRY IS 'snapshot log for master table SDSADM.STD_COUNTRY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COUNTRY FOR SDSADM.MLOG$_STD_COUNTRY;


GRANT SELECT ON SDSADM.MLOG$_STD_COUNTRY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CORRESPONDENCETY1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CORRESPONDENCETY1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255),
  XID$$            NUMBER
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CORRESPONDENCETY1 IS 'snapshot log for master table SDSADM.STD_CORRESPONDENCETYPEHISTORY';


CREATE INDEX SDSADM.I_MLOG$_STD_CORRESPONDENCE1 ON SDSADM.MLOG$_STD_CORRESPONDENCETY1
(XID$$)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

GRANT SELECT ON SDSADM.MLOG$_STD_CORRESPONDENCETY1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CORRESPONDENCETY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CORRESPONDENCETY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255),
  XID$$            NUMBER
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CORRESPONDENCETY IS 'snapshot log for master table SDSADM.STD_CORRESPONDENCETYPE';


CREATE INDEX SDSADM.I_MLOG$_STD_CORRESPONDENCE ON SDSADM.MLOG$_STD_CORRESPONDENCETY
(XID$$)
LOGGING
TABLESPACE S_DATA_01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      KEEP
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
NOPARALLEL;

GRANT SELECT ON SDSADM.MLOG$_STD_CORRESPONDENCETY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CONFIDENTIALADDR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CONFIDENTIALADDR
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CONFIDENTIALADDR IS 'snapshot log for master table SDSADM.STD_CONFIDENTIALADDRESSCAT';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CONFIDENTIALADDR FOR SDSADM.MLOG$_STD_CONFIDENTIALADDR;


GRANT SELECT ON SDSADM.MLOG$_STD_CONFIDENTIALADDR TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CONFADDRCATHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CONFADDRCATHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CONFADDRCATHISTO IS 'snapshot log for master table SDSADM.STD_CONFADDRCATHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CONFADDRCATHISTO FOR SDSADM.MLOG$_STD_CONFADDRCATHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_CONFADDRCATHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CONDITIONCODEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CONDITIONCODEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CONDITIONCODEHIS IS 'snapshot log for master table SDSADM.STD_CONDITIONCODEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CONDITIONCODEHIS FOR SDSADM.MLOG$_STD_CONDITIONCODEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_CONDITIONCODEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CONDITIONCODE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CONDITIONCODE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CONDITIONCODE IS 'snapshot log for master table SDSADM.STD_CONDITIONCODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CONDITIONCODE FOR SDSADM.MLOG$_STD_CONDITIONCODE;


GRANT SELECT ON SDSADM.MLOG$_STD_CONDITIONCODE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COMBATSVCSOURCEH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COMBATSVCSOURCEH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COMBATSVCSOURCEH IS 'snapshot log for master table SDSADM.STD_COMBATSVCSOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COMBATSVCSOURCEH FOR SDSADM.MLOG$_STD_COMBATSVCSOURCEH;


GRANT SELECT ON SDSADM.MLOG$_STD_COMBATSVCSOURCEH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COMBATSVCSOURCE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COMBATSVCSOURCE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COMBATSVCSOURCE IS 'snapshot log for master table SDSADM.STD_COMBATSVCSOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COMBATSVCSOURCE FOR SDSADM.MLOG$_STD_COMBATSVCSOURCE;


GRANT SELECT ON SDSADM.MLOG$_STD_COMBATSVCSOURCE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COMBATSVCLOCATIO1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COMBATSVCLOCATIO1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COMBATSVCLOCATIO1 IS 'snapshot log for master table SDSADM.STD_COMBATSVCLOCATIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COMBATSVCLOCATIO1 FOR SDSADM.MLOG$_STD_COMBATSVCLOCATIO1;


GRANT SELECT ON SDSADM.MLOG$_STD_COMBATSVCLOCATIO1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COMBATSVCLOCATIO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COMBATSVCLOCATIO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COMBATSVCLOCATIO IS 'snapshot log for master table SDSADM.STD_COMBATSVCLOCATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COMBATSVCLOCATIO FOR SDSADM.MLOG$_STD_COMBATSVCLOCATIO;


GRANT SELECT ON SDSADM.MLOG$_STD_COMBATSVCLOCATIO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COMBATPAYTYPEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COMBATPAYTYPEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COMBATPAYTYPEHIS IS 'snapshot log for master table SDSADM.STD_COMBATPAYTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COMBATPAYTYPEHIS FOR SDSADM.MLOG$_STD_COMBATPAYTYPEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_COMBATPAYTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COMBATPAYTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COMBATPAYTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COMBATPAYTYPE IS 'snapshot log for master table SDSADM.STD_COMBATPAYTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COMBATPAYTYPE FOR SDSADM.MLOG$_STD_COMBATPAYTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_COMBATPAYTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COMBATLOCATIONHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COMBATLOCATIONHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COMBATLOCATIONHI IS 'snapshot log for master table SDSADM.STD_COMBATLOCATIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COMBATLOCATIONHI FOR SDSADM.MLOG$_STD_COMBATLOCATIONHI;


GRANT SELECT ON SDSADM.MLOG$_STD_COMBATLOCATIONHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COMBATLOCATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COMBATLOCATION
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COMBATLOCATION IS 'snapshot log for master table SDSADM.STD_COMBATLOCATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COMBATLOCATION FOR SDSADM.MLOG$_STD_COMBATLOCATION;


GRANT SELECT ON SDSADM.MLOG$_STD_COMBATLOCATION TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COLLECTIONMETHOD CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COLLECTIONMETHOD
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COLLECTIONMETHOD IS 'snapshot log for master table SDSADM.STD_COLLECTIONMETHOD';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COLLECTIONMETHOD FOR SDSADM.MLOG$_STD_COLLECTIONMETHOD;


GRANT SELECT ON SDSADM.MLOG$_STD_COLLECTIONMETHOD TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_COLLECTIONHISTOR CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_COLLECTIONHISTOR
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_COLLECTIONHISTOR IS 'snapshot log for master table SDSADM.STD_COLLECTIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_COLLECTIONHISTOR FOR SDSADM.MLOG$_STD_COLLECTIONHISTOR;


GRANT SELECT ON SDSADM.MLOG$_STD_COLLECTIONHISTOR TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CODINGSYSTEMHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CODINGSYSTEMHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CODINGSYSTEMHIST IS 'snapshot log for master table SDSADM.STD_CODINGSYSTEMHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CODINGSYSTEMHIST FOR SDSADM.MLOG$_STD_CODINGSYSTEMHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_CODINGSYSTEMHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CODINGSYSTEM CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CODINGSYSTEM
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CODINGSYSTEM IS 'snapshot log for master table SDSADM.STD_CODINGSYSTEM';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CODINGSYSTEM FOR SDSADM.MLOG$_STD_CODINGSYSTEM;


GRANT SELECT ON SDSADM.MLOG$_STD_CODINGSYSTEM TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CODESET CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CODESET
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CODESET IS 'snapshot log for master table SDSADM.STD_CODESET';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CODESET FOR SDSADM.MLOG$_STD_CODESET;


GRANT SELECT ON SDSADM.MLOG$_STD_CODESET TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CLINDETERTYPEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CLINDETERTYPEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CLINDETERTYPEHIS IS 'snapshot log for master table SDSADM.STD_CLINDETERTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CLINDETERTYPEHIS FOR SDSADM.MLOG$_STD_CLINDETERTYPEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_CLINDETERTYPEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CLINDETERTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CLINDETERTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CLINDETERTYPE IS 'snapshot log for master table SDSADM.STD_CLINDETERTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CLINDETERTYPE FOR SDSADM.MLOG$_STD_CLINDETERTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_CLINDETERTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CATADISABILITYEX1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CATADISABILITYEX1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CATADISABILITYEX1 IS 'snapshot log for master table SDSADM.STD_CATADISABILITYEXTCDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CATADISABILITYEX1 FOR SDSADM.MLOG$_STD_CATADISABILITYEX1;


GRANT SELECT ON SDSADM.MLOG$_STD_CATADISABILITYEX1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CATADISABILITYEX CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CATADISABILITYEX
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CATADISABILITYEX IS 'snapshot log for master table SDSADM.STD_CATADISABILITYEXTCD';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CATADISABILITYEX FOR SDSADM.MLOG$_STD_CATADISABILITYEX;


GRANT SELECT ON SDSADM.MLOG$_STD_CATADISABILITYEX TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CANCELDECLINESTT1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CANCELDECLINESTT1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CANCELDECLINESTT1 IS 'snapshot log for master table SDSADM.STD_CANCELDECLINESTTYPHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CANCELDECLINESTT1 FOR SDSADM.MLOG$_STD_CANCELDECLINESTT1;


GRANT SELECT ON SDSADM.MLOG$_STD_CANCELDECLINESTT1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CANCELDECLINESTT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CANCELDECLINESTT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CANCELDECLINESTT IS 'snapshot log for master table SDSADM.STD_CANCELDECLINESTTYP';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CANCELDECLINESTT FOR SDSADM.MLOG$_STD_CANCELDECLINESTT;


GRANT SELECT ON SDSADM.MLOG$_STD_CANCELDECLINESTT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CANCELDECLINEREA CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CANCELDECLINEREA
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CANCELDECLINEREA IS 'snapshot log for master table SDSADM.STD_CANCELDECLINEREASON';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CANCELDECLINEREA FOR SDSADM.MLOG$_STD_CANCELDECLINEREA;


GRANT SELECT ON SDSADM.MLOG$_STD_CANCELDECLINEREA TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_CANCELDECLINEHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_CANCELDECLINEHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_CANCELDECLINEHIS IS 'snapshot log for master table SDSADM.STD_CANCELDECLINEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_CANCELDECLINEHIS FOR SDSADM.MLOG$_STD_CANCELDECLINEHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_CANCELDECLINEHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_BILLINGTRANSTYPE1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_BILLINGTRANSTYPE1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_BILLINGTRANSTYPE1 IS 'snapshot log for master table SDSADM.STD_BILLINGTRANSTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_BILLINGTRANSTYPE1 FOR SDSADM.MLOG$_STD_BILLINGTRANSTYPE1;


GRANT SELECT ON SDSADM.MLOG$_STD_BILLINGTRANSTYPE1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_BILLINGTRANSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_BILLINGTRANSTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_BILLINGTRANSTYPE IS 'snapshot log for master table SDSADM.STD_BILLINGTRANSTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_BILLINGTRANSTYPE FOR SDSADM.MLOG$_STD_BILLINGTRANSTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_BILLINGTRANSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_BENEFITSCOORDTYP1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_BENEFITSCOORDTYP1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_BENEFITSCOORDTYP1 IS 'snapshot log for master table SDSADM.STD_BENEFITSCOORDTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_BENEFITSCOORDTYP1 FOR SDSADM.MLOG$_STD_BENEFITSCOORDTYP1;


GRANT SELECT ON SDSADM.MLOG$_STD_BENEFITSCOORDTYP1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_BENEFITSCOORDTYP CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_BENEFITSCOORDTYP
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_BENEFITSCOORDTYP IS 'snapshot log for master table SDSADM.STD_BENEFITSCOORDTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_BENEFITSCOORDTYP FOR SDSADM.MLOG$_STD_BENEFITSCOORDTYP;


GRANT SELECT ON SDSADM.MLOG$_STD_BENEFITSCOORDTYP TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ASSIGNINGAUTHORI1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ASSIGNINGAUTHORI1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ASSIGNINGAUTHORI1 IS 'snapshot log for master table SDSADM.STD_ASSIGNINGAUTHORITYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ASSIGNINGAUTHORI1 FOR SDSADM.MLOG$_STD_ASSIGNINGAUTHORI1;


GRANT SELECT ON SDSADM.MLOG$_STD_ASSIGNINGAUTHORI1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ASSIGNINGAUTHORI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ASSIGNINGAUTHORI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ASSIGNINGAUTHORI IS 'snapshot log for master table SDSADM.STD_ASSIGNINGAUTHORITY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ASSIGNINGAUTHORI FOR SDSADM.MLOG$_STD_ASSIGNINGAUTHORI;


GRANT SELECT ON SDSADM.MLOG$_STD_ASSIGNINGAUTHORI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ASSETTYPEHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ASSETTYPEHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ASSETTYPEHISTORY IS 'snapshot log for master table SDSADM.STD_ASSETTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ASSETTYPEHISTORY FOR SDSADM.MLOG$_STD_ASSETTYPEHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_ASSETTYPEHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ASSETTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ASSETTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ASSETTYPE IS 'snapshot log for master table SDSADM.STD_ASSETTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ASSETTYPE FOR SDSADM.MLOG$_STD_ASSETTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_ASSETTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_APPLICATIONHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_APPLICATIONHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_APPLICATIONHISTO IS 'snapshot log for master table SDSADM.STD_APPLICATIONHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_APPLICATIONHISTO FOR SDSADM.MLOG$_STD_APPLICATIONHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_APPLICATIONHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_APPLICATION CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_APPLICATION
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_APPLICATION IS 'snapshot log for master table SDSADM.STD_APPLICATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_APPLICATION FOR SDSADM.MLOG$_STD_APPLICATION;


GRANT SELECT ON SDSADM.MLOG$_STD_APPLICATION TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ALLIEDCOUNTRYHIS CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ALLIEDCOUNTRYHIS
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ALLIEDCOUNTRYHIS IS 'snapshot log for master table SDSADM.STD_ALLIEDCOUNTRYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ALLIEDCOUNTRYHIS FOR SDSADM.MLOG$_STD_ALLIEDCOUNTRYHIS;


GRANT SELECT ON SDSADM.MLOG$_STD_ALLIEDCOUNTRYHIS TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ALLIEDCOUNTRY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ALLIEDCOUNTRY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ALLIEDCOUNTRY IS 'snapshot log for master table SDSADM.STD_ALLIEDCOUNTRY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ALLIEDCOUNTRY FOR SDSADM.MLOG$_STD_ALLIEDCOUNTRY;


GRANT SELECT ON SDSADM.MLOG$_STD_ALLIEDCOUNTRY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_AGENTORANGELOCNH CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_AGENTORANGELOCNH
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_AGENTORANGELOCNH IS 'snapshot log for master table SDSADM.STD_AGENTORANGELOCNHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_AGENTORANGELOCNH FOR SDSADM.MLOG$_STD_AGENTORANGELOCNH;


GRANT SELECT ON SDSADM.MLOG$_STD_AGENTORANGELOCNH TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_AGENTORANGELOCAT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_AGENTORANGELOCAT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_AGENTORANGELOCAT IS 'snapshot log for master table SDSADM.STD_AGENTORANGELOCATION';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_AGENTORANGELOCAT FOR SDSADM.MLOG$_STD_AGENTORANGELOCAT;


GRANT SELECT ON SDSADM.MLOG$_STD_AGENTORANGELOCAT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_AGENCYHISTORY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_AGENCYHISTORY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_AGENCYHISTORY IS 'snapshot log for master table SDSADM.STD_AGENCYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_AGENCYHISTORY FOR SDSADM.MLOG$_STD_AGENCYHISTORY;


GRANT SELECT ON SDSADM.MLOG$_STD_AGENCYHISTORY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_AGENCY CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_AGENCY
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_AGENCY IS 'snapshot log for master table SDSADM.STD_AGENCY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_AGENCY FOR SDSADM.MLOG$_STD_AGENCY;


GRANT SELECT ON SDSADM.MLOG$_STD_AGENCY TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_AFFECTEDEXTREMIT1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_AFFECTEDEXTREMIT1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_AFFECTEDEXTREMIT1 IS 'snapshot log for master table SDSADM.STD_AFFECTEDEXTREMITYHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_AFFECTEDEXTREMIT1 FOR SDSADM.MLOG$_STD_AFFECTEDEXTREMIT1;


GRANT SELECT ON SDSADM.MLOG$_STD_AFFECTEDEXTREMIT1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_AFFECTEDEXTREMIT CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_AFFECTEDEXTREMIT
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_AFFECTEDEXTREMIT IS 'snapshot log for master table SDSADM.STD_AFFECTEDEXTREMITY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_AFFECTEDEXTREMIT FOR SDSADM.MLOG$_STD_AFFECTEDEXTREMIT;


GRANT SELECT ON SDSADM.MLOG$_STD_AFFECTEDEXTREMIT TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ADRSINVALRSNHIST CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ADRSINVALRSNHIST
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ADRSINVALRSNHIST IS 'snapshot log for master table SDSADM.STD_ADRSINVALRSNHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ADRSINVALRSNHIST FOR SDSADM.MLOG$_STD_ADRSINVALRSNHIST;


GRANT SELECT ON SDSADM.MLOG$_STD_ADRSINVALRSNHIST TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ADRSDLVRYFLRCDHI CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ADRSDLVRYFLRCDHI
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ADRSDLVRYFLRCDHI IS 'snapshot log for master table SDSADM.STD_ADRSDLVRYFLRCDHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ADRSDLVRYFLRCDHI FOR SDSADM.MLOG$_STD_ADRSDLVRYFLRCDHI;


GRANT SELECT ON SDSADM.MLOG$_STD_ADRSDLVRYFLRCDHI TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ADMINISTRATIVEEN CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ADMINISTRATIVEEN
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ADMINISTRATIVEEN IS 'snapshot log for master table SDSADM.STD_ADMINISTRATIVEENTITY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ADMINISTRATIVEEN FOR SDSADM.MLOG$_STD_ADMINISTRATIVEEN;


GRANT SELECT ON SDSADM.MLOG$_STD_ADMINISTRATIVEEN TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ADDRESSTYPEHISTO CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ADDRESSTYPEHISTO
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ADDRESSTYPEHISTO IS 'snapshot log for master table SDSADM.STD_ADDRESSTYPEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ADDRESSTYPEHISTO FOR SDSADM.MLOG$_STD_ADDRESSTYPEHISTO;


GRANT SELECT ON SDSADM.MLOG$_STD_ADDRESSTYPEHISTO TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ADDRESSTYPE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ADDRESSTYPE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ADDRESSTYPE IS 'snapshot log for master table SDSADM.STD_ADDRESSTYPE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ADDRESSTYPE FOR SDSADM.MLOG$_STD_ADDRESSTYPE;


GRANT SELECT ON SDSADM.MLOG$_STD_ADDRESSTYPE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ADDRESSINVALIDRE CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ADDRESSINVALIDRE
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ADDRESSINVALIDRE IS 'snapshot log for master table SDSADM.STD_ADDRESSINVALIDREASON';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ADDRESSINVALIDRE FOR SDSADM.MLOG$_STD_ADDRESSINVALIDRE;


GRANT SELECT ON SDSADM.MLOG$_STD_ADDRESSINVALIDRE TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ADDRESSDELIVERYF CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ADDRESSDELIVERYF
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ADDRESSDELIVERYF IS 'snapshot log for master table SDSADM.STD_ADDRESSDELIVERYFAILURECODE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ADDRESSDELIVERYF FOR SDSADM.MLOG$_STD_ADDRESSDELIVERYF;


GRANT SELECT ON SDSADM.MLOG$_STD_ADDRESSDELIVERYF TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ADDRESSCHANGESOU1 CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ADDRESSCHANGESOU1
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ADDRESSCHANGESOU1 IS 'snapshot log for master table SDSADM.STD_ADDRESSCHANGESOURCEHISTORY';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ADDRESSCHANGESOU1 FOR SDSADM.MLOG$_STD_ADDRESSCHANGESOU1;


GRANT SELECT ON SDSADM.MLOG$_STD_ADDRESSCHANGESOU1 TO SDS_PROXY;
DROP TABLE SDSADM.MLOG$_STD_ADDRESSCHANGESOU CASCADE CONSTRAINTS;

CREATE TABLE SDSADM.MLOG$_STD_ADDRESSCHANGESOU
(
  ID               NUMBER(20),
  SNAPTIME$$       DATE,
  DMLTYPE$$        VARCHAR2(1 BYTE),
  OLD_NEW$$        VARCHAR2(1 BYTE),
  CHANGE_VECTOR$$  RAW(255)
)
TABLESPACE S_DATA_01
RESULT_CACHE (MODE DEFAULT)
PCTUSED    0
PCTFREE    60
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            NEXT             128K
            MAXSIZE          UNLIMITED
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
            FLASH_CACHE      DEFAULT
            CELL_FLASH_CACHE DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;

COMMENT ON TABLE SDSADM.MLOG$_STD_ADDRESSCHANGESOU IS 'snapshot log for master table SDSADM.STD_ADDRESSCHANGESOURCE';


CREATE OR REPLACE PUBLIC SYNONYM MLOG$_STD_ADDRESSCHANGESOU FOR SDSADM.MLOG$_STD_ADDRESSCHANGESOU;


GRANT SELECT ON SDSADM.MLOG$_STD_ADDRESSCHANGESOU TO SDS_PROXY;
