Skip to main content



how does it works "ADD VERSIONING" and "USE HISTORY TABLE" to take trace of every changes on a table. This looks like magic!

This looks like magic! The operating system, in a totally automatic way, keeps track of every change in the data. This simple technique allows you to find the value of a field on a certain date and time. use STRSQL Step 1) CREATE TABLE CUSTOMER (CUSTOMER_ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH +1 INCREMENT BY +1 ) ,CUSTOMER_NAME VARCHAR(10) ,ADDRESS VARCHAR(20)) Step 2) alter table customer add system_start timestamp(12) generated always as row begin not null add system_end timestamp(12) generated always as row end not null add tx_start timestamp(12) generated always as transaction start id implicitly hidden add period system_time (system_start, system_end) Step 3) create table customer_h like customer Step 4) alter table customer add versioning use history table customer_h Step 5) Now use command line: CRTJRNRCV JRNRCV(VDOTEST1/JRNRCVNAME) THRESHOLD(150) TEXT('Journal receiver') Step 6) CRTJRN JRN(VDOTEST1/jrnname) JRNRCV(VDOTEST1/jrnrcvname) MNGRCV

Latest Posts

RPG Free. Minimalist program vith a single video format

How to store passwords in a secure way in a DB2 SQL Server database

How to print with a externally described printer file

How to add an HELP panel (Minimalist example) to a DSPF - HELP - ALTHELP - HLPARA - HLPPNLGRP

HOW TO add/subtract days to a date FROM CL (CONTROL LANGUAGE)


How to get today's date from CL (Control Language)

Fully Free RPG: Procedure with a parameter and return value

QSQGNDDL API: How to get SQL SOURCE specification from a database object

Reverse date 6 0 in one instruction