|
While it is true that the default is not respected,
CreatedTS timestamp with default current timestamp,
the rest of the values are not affected and override RPG write and updates
audit_user VARCHAR(128) GENERATED ALWAYS AS (SESSION_USER),
audit_op CHAR(1) GENERATED ALWAYS AS (DATA CHANGE OPERATION),
Row_Change_TS timestamp for each row on update as row change timestamp
not null,
as tested with
create table rob.jr2
(
mychar char(5),
CreatedTS timestamp with default current timestamp,
audit_user VARCHAR(128) GENERATED ALWAYS AS (SESSION_USER),
audit_op CHAR(1) GENERATED ALWAYS AS (DATA CHANGE OPERATION),
Row_Change_TS timestamp for each row on update as row change timestamp not
null,
constraint pkmychar primary key (mychar)
)
rcdfmt jr2r
;
ctl-opt option(*srcstmt)
datfmt(*iso) timfmt(*iso)
debug(*yes)
alwnull(*usrctl);
dcl-f jr2 disk(*ext) usage(*input : *output : *update) keyed alias;
dcl-s mykey like(mychar);
dcl-s debugchar char(52);
mychar='Go';
write jr2r;
mykey = 'Go';
chain mykey jr2;
dsply createdts;
debugchar = audit_user;
dsply debugchar;
dsply audit_op;
dsply row_change_ts;
mychar = 'Team!';
update jr2r;
mykey = 'Team!';
chain mykey jr2;
dsply createdts;
debugchar = audit_user;
dsply debugchar;
dsply audit_op;
dsply row_change_ts;
*inlr=*on;
return;
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.