Update DML handler
-- Insert
info about the LCR into the hist_upd table
INSERT INTO ny4.hist_upd VALUES
(SYSDATE,
lcr.GET_SOURCE_DATABASE_NAME(),
lcr.GET_COMMAND_TYPE(),
lcr.GET_OBJECT_OWNER(),
lcr.GET_OBJECT_NAME(),
lcr.GET_TAG(),
lcr.GET_TRANSACTION_ID(),
lcr.GET_SCN(),
lcr.GET_COMMIT_SCN,
blk_user,
blk_txname,
blk_sid,
lcr.GET_VALUES('old'),
lcr.GET_VALUES('new', 'n') );
-- Apply row LCR
lcr.EXECUTE(true);
END;
/
From the above procedure, it is apparent
that the old and new values of updated columns besides the other
details can be saved into the table, NY4.HIST_UPD. Every update
transaction is recorded into the table. It also records some
additional attributes such as username, transaction name, etc.