I've made an SQL trigger to log a file when a field is updated.
as you can see, I'm trying to use current client_applname to fetch the program used to update the file. I've found it works with DBU and interactive sql, however, it returns nothing from an RPGLE program.
I was thinking I could Create an SQL function that calls something like this.... but I'm lost
Util_Belt has the PSDS defined in it.
@mod is positions 1-10.
Code:
Create Trigger edi04_xshadd After update of xshadd on edilib/edi040f Referencing old as old_dta new as new_dta For each row mode db2sql When (old_dta.xshadd <> new_dta.xshadd) Insert into astest2/cr_chglog Values('EDILIB', 'EDI040F', 'XSHADD', old_dta.xshadd, new_dta.xshadd, new_dta.xpocus, //ref#1 new_dta.xpo22, //ref#2 new_dta.XPODTE, //ref#3 new_dta.XSTORE, //ref#4 ' ', //ref#5 current_user, current client_applname, current_timestamp);
I was thinking I could Create an SQL function that calls something like this.... but I'm lost
Code:
H nomain /copy Maputil/qrpglesrc,util_belt P PgmProc b export D pi D pgm 10a /free pgm = @mod; return; /end-free P e
@mod is positions 1-10.
Comment