pass parameters to a Trigger?

  • Thread starter Thread starter DraguVaso
  • Start date Start date
D

DraguVaso

Hi,

I have an application with an SQL-database in which I want to put Triggers.

I want to create a Trigger like this:

I do an INSERT to a Table, and the Trigger has to perform an INSERT with
paramters OTHER than the parameters passed by the intial INSERT-statement.
Like for exemple creating somewhere a log with the username of the user
which is working with the application.

Is this possibly? And if yes: how?

Thanks a lot,

Pieter
 
Since you can't pass a parameter to an INSERT statement (apart for the
values list, of course), how would the trigger get its parameters?

One way is to, before the INSERT statement, so an insert into some other
table, and let the trigger read those values off of that table. You need to
handle concurrent users, of course. And handle cleanup as well.
 
Back
Top