Re: environment var in trigger
Posted in 1995
In article <slivi.35.000BC715@interaccess.com>, slivi@interaccess.com (Sandy Livingston) says: > >I'm trying to create a simple audit trail trigger. >On update of a cost field, I'm going to to insert >into an audit table the pre & post values of the >cost, the item code, warehouse code, some other >fields that are in the same table, and the user >& current (date/time). What I'd also really like >to get in the table is what program caused the >trigger to occur. ....<clipped> One idea is to get the program that is making the changes to the data put its name and / or user id into the table being changed. Create a new field in the table called, say, last_changed_by and have any program making a change put its name there. You could also get a date/time stamp put in at the same time. Then, your insert or update trigger can use a stored procedure to write this data into the audit table. I don't believe that a trigger can read the environment variable of the shell of the user doing an insert.