DROP TRIGGER T_UNKNOWNPKVC1;
DROP TRIGGER T_UNKNOWNPKVC2;

DROP TABLE UNKNOWNPKVC1;
DROP TABLE UNKNOWNPKVC2;

CREATE TABLE UNKNOWNPKVC1
(
    ID     NUMERIC(30)    PRIMARY KEY NOT NULL,
    NAME   VARCHAR(32),
    VERSION NUMERIC(19)    NOT NULL
);

CREATE TABLE UNKNOWNPKVC2
(
    ID     NUMERIC(30)      PRIMARY KEY NOT NULL,
    NAME   VARCHAR(32),
    VERSION NUMERIC(19)    NOT NULL
);

CREATE TRIGGER T_UNKNOWNPKVC1
      AFTER UPDATE ON UNKNOWNPKVC1
   REFERENCING
            OLD AS O_ROW
   FOR EACH ROW MODE DB2SQL
   UPDATE UNKNOWNPKVC1 SET version = O_ROW.version + 1
       WHERE ID = O_ROW.ID
;

CREATE TRIGGER T_UNKNOWNPKVC2
      AFTER UPDATE ON UNKNOWNPKVC2
   REFERENCING
            OLD AS O_ROW
   FOR EACH ROW MODE DB2SQL
   UPDATE UNKNOWNPKVC2 SET version = O_ROW.version + 1
       WHERE ID = O_ROW.ID
;
