Re: Triggers & SQL
Posted in 2000
Your SP should be able to determine the PID of the session that has invoked it (using DBINFO('sessionid') to look up sysmaster:syssessions.pid). sysessions also has a column called 'feprogram', but its not populated in my version, 7.31UC2 - check yours! If task1 & task2 (in your example below) need not be part of the base transaction, you could then invoke a shell script (using the SYSTEM command, possibly in the background) passing the PID as an argument. The shell script could easily evaluate the program name using PID and then invoke either task1 or task2. Of course, you'd probably kill your box in the process - SYSTEM calls are expensive - but if the program code is outside your control, and it is essential to do this because of security, and you expect invokations to be infrequent and ....whatever! Rudy Matthew Smith wrote: > > Hello, > > I have RTFM and searched the archives but to no avail. Is there a method > to determine the program name of the process which invokes a trigger > using SPL? I want to perform a different task depending on the program > invoking a trigger. For example, > > when prog1.4gi invokes trigger then perform task1, > when prog2.4gi invokes trigger then perform task2. > > TIA.