pass parameters to a Trigger?

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
 
T

Tibor Karaszi

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top