· Jan 22

System Process and Session Information in Triggers

Hi all,

I am trying to use some process private variables (percent variables) in Triggers.

I am referring to values from $System.Process, like the ClientIPAddress and CSPSessionID.
These do to not contain values and I suspect it is bacause of scope. I also checked, and the %session variable is not available if the change originated from a CSP request.
I know that in triggers the scope of the variables are to be kept local, that is why NEW is to be used.

Is there a way to access the Process Private Variables in Triggers or get $System.Process to return the correct values?


Product version: IRIS 2022.3
Discussion (10)1
Log in or sign up to continue

Thank you for clarifying. That makes sense.

It would have been nice to still have that information accessible somehow. If you add audit logs and other things based on triggers, you lose that traceability if SMP is used. This does create a bit of a gap in the audit trail if you are keeping one based on trigger events. The Dynamic SQL audit event can be used, but you can't link it directly to a record that has been updated or deleted, if you are using information that is only available in %session.

Can the InBackground behaviour be changed in a configuration?

I could imagine 2 variants:

  • creating a "clone" of the CSP based "synchronous" Queries we know from C/E to have the unique session
  • just using xDBC based tools such as Squirrel, DBeaver, WinSQL, ..... which is probably better since SMP mimics ODBC mode, but doesn't use real xDBC connection
  • external xDBC provides a 1:1 connection as a terminal session would do.     


in SMP IRIS you see this header as in Caché / Ensemble

but click to more  has a surprise in IRIS

Select foreground and you get all %session, .... that you look for.
Recorded with SPOOL , device 2
%application=<OBJECT REFERENCE>[356@%CSP.UI.Portal.Application]
%obj=<OBJECT REFERENCE>[362@%ZEN.Component.html]
%page=<OBJECT REFERENCE>[20@%CSP.UI.Portal.SQL.Home]
%request=<OBJECT REFERENCE>[1@%CSP.Request]
%response=<OBJECT REFERENCE>[2@%CSP.Response]
%session=<OBJECT REFERENCE>[3@%CSP.Session]
%sqlcontext=<OBJECT REFERENCE>[433@%Library.ProcedureContext]
%tStatement=<OBJECT REFERENCE>[369@%SQL.Statement]
<Private variables>

Reverse engineering of the SMP page uncovered this new checkbox to me.
Could be it is documented somewhere


The IRIS 2022.3 documentation has this:

  • Execute Query in the foreground: a check box specifying whether or not to run the query in the foreground. Simple queries run in the foreground are often significantly faster than those run in the background. However, long queries run in the foreground may cause the Management Portal to be unresponsive during query execution. The default is to run all queries in the background.