Home » SQL & PL/SQL » SQL & PL/SQL » Number of triggers in a table.
Number of triggers in a table. [message #233503] Thu, 26 April 2007 07:23 Go to next message
caliguardo
Messages: 107
Registered: February 2007
Location: Chennai
Senior Member

Is there any limitation on the number of triggers in a table?.
if so, Maximum of how many triggers can be written in a table?

Can anybody help me?
Re: Number of triggers in a table. [message #233504 is a reply to message #233503] Thu, 26 April 2007 07:30 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
You can have as many triggers as you want
but, there are only a couple of different types, combined with triggering moments and scopes.
This gives a total of 12 different types.
(Now YOU find out which 12 Smile)

Oh, and to answer your next question:
No, that is not possible.


(that is the question: is it possible to force oracle to fire my 1 before-insert-row trigger before the other before-insert-row trigger?)
Re: Number of triggers in a table. [message #233510 is a reply to message #233504] Thu, 26 April 2007 07:48 Go to previous messageGo to next message
Michel Cadot
Messages: 64110
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Frank, 11g will allow that. Wink

Regards
Michel
Re: Number of triggers in a table. [message #233512 is a reply to message #233510] Thu, 26 April 2007 07:56 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Pff. show me ! Copy-paste from sqlplus please!

Razz
Re: Number of triggers in a table. [message #233519 is a reply to message #233512] Thu, 26 April 2007 08:06 Go to previous messageGo to next message
Michel Cadot
Messages: 64110
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
create or replace trigger my_trigger_2 before insert on my_table 
follows my_trigger_1
begin null; end;
/

Nod

Regards
Michel
Re: Number of triggers in a table. [message #233538 is a reply to message #233512] Thu, 26 April 2007 08:34 Go to previous messageGo to next message
caliguardo
Messages: 107
Registered: February 2007
Location: Chennai
Senior Member

So at the MAX 12 triggers only can be written in a table .Is that right?
Re: Number of triggers in a table. [message #233541 is a reply to message #233538] Thu, 26 April 2007 08:46 Go to previous messageGo to next message
Michel Cadot
Messages: 64110
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No. As Frank said:
Quote:
You can have as many triggers as you want

But
Quote:
This gives a total of 12 different types

There are 12 types but how many you want in each type.

Regards
Michel

[Updated on: Thu, 26 April 2007 08:46]

Report message to a moderator

Re: Number of triggers in a table. [message #233542 is a reply to message #233541] Thu, 26 April 2007 08:48 Go to previous messageGo to next message
caliguardo
Messages: 107
Registered: February 2007
Location: Chennai
Senior Member

Oh,That's fine. Now things are clear.
Re: Number of triggers in a table. [message #233592 is a reply to message #233503] Thu, 26 April 2007 14:59 Go to previous message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
But as was already mentioned. For each of the 12 types, you can have as many of the same type as you want, but all the triggers of the same type will run in random order every time they are triggered. Typically if you have multiple triggers of (for example) before update for each row, you should combine the triggers into a single trigger that performs the procedures in the order that you want them processed.
Previous Topic: List all constraints in a database
Next Topic: Latest Record
Goto Forum:
  


Current Time: Mon Dec 05 11:05:44 CST 2016

Total time taken to generate the page: 0.13976 seconds