Re: Triggers & SQL
Posted in 2000
Greetings. Just my $ 0.02, but the best solution to a problem like this is ... re-think your design! Your request violates every known tenet of proper application software design, and especially that of encapsulation. Procedures - in ANY language - are not supposed to know who called them. In making them so aware, you create needless dependencies which thwart your ongoing maintenance efforts. What I would do is write two very small "wrapper" stored procedures, one called by one invoking program, the other by the other(s). These wrapper procedures would then set a flag or a parameter, and call your "main" stored procedure, passing that parameter. The main stored procedure should then never be directly called by an application program. Rich 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. -- Richard C. Auslander Database Manager AirFlash, Inc. 1733 Woodside Rd., Suite #110 Redwood City, CA 94061 (650) 556-7928 www.airflash.com