0

Can we call a single trigger for multiple tables....

say I have two identical tables a and b.

now we have a trigger that is needed to be called by each table.

It is possible in POSTGRESQL using Triggers function....

these functions allow to call a single trigger function from multiple tables....

Is it possible in mysql???

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by rpandia31
0

I think you could code a stand-alone procedure and call this procedure from your different triggers. But you cannot define one trigger for multiple tables in MySQL.
Maybe it's possible with an ugly hack. In MySQL 5.1 triggers are stored as external files. You might link several of those files to the same source.

Edited by smantscheff: n/a

0

I have already tried that!!

I have created a procedure and then called it through the triggers....but then I have to send all the 92 column of the table as a parameters....and in each table there are more than 5 lac record so it is consuming lot of time as a result of which processing gets very slow....

However i haven't used mysql5.1, will look into it...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.