Ever wondered what special registers there are and what they are set to on your DB2 for IBM i? Well run this SQL script and find out:

[code language=”sql”]
SELECT CURRENT CLIENT_ACCTNG AS ACCOUNTINGSTRINGSPCREG,
CURRENT CLIENT_APPLNAME AS APPLICATIONNAMESPCREG,
CURRENT CLIENT_PROGRAMID AS CLIENTPROGRAMIDSPCREG,
CURRENT CLIENT_USERID AS CLIENTUSERIDSPCREG,
CURRENT CLIENT_WRKSTNNAME AS WORKSTATIONNAMESPCREG,
CURRENT_DATE AS CURRENTDATESPCREG,
CURRENT DEBUG MODE AS DEBUGMODESPCREG,
CURRENT DECFLOAT ROUNDING MODE AS DECROUNDINGMODESPCREG,
CURRENT DEGREE AS DEGREEOFIOOFSMPSPCREG,
CURRENT_PATH AS PATHFORUNQUALIFIEDNAMESSPCREG,
CURRENT_SCHEMA AS CURRENTSCHEMASPCREG,
CURRENT_SERVER AS CURRENTSERVERSPCREG,
CURRENT_TIME AS CURRENTTIMESPCREG,
CURRENT_TIMESTAMP AS CURRENTTIMESTAMPSPCREG,
CURRENT_TIMEZONE AS CURRENTTIMEZONESPCREG,
SESSION_USER AS SESSIONUSRSPCREG,
USER AS USERVALUESPCREG,
SYSTEM_USER AS SYSTEMUSERSPCREG
FROM SYSIBM.SYSDUMMY1;

— CURRENT USER was added in IBM i 7.2
[/code]

You can use these values at anytime in your SQL script. Perhaps you want to save the current time and the user that made the change to the record.