Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Regarding Trigger costraint

bootstrapAug 14 2018 — edited Aug 14 2018

There is a table say T1 where in data is inserted in T1 through database link from other database. A Trigger on T1 table inserts data in another table T2.

Is it possible to have another insert trigger on table T2 which inserts data in another table T3.

Is there any constraint in defining trigger on table T2 ?

Comments

John Thorton

bootstrap wrote:

There is a table say T1 where in data is inserted in T1 through database link from other database. A Trigger on T1 table inserts data in another table T2.

Is it possible to have another insert trigger on table T2 which inserts data in another table T3.

Is there any constraint in defining trigger on table T2 ?

no

What problem are you trying to solve?

Please read & follow URL below

How do I ask a question on the forums?


https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:2575882200346616184
http://www.oracle.com/technetwork/testcontent/o58asktom-101055.html
http://rwijk.blogspot.com/2007/09/database-triggers-are-evil.html
https://stackoverflow.com/questions/460316/are-database-triggers-evil

EdStevens

bootstrap wrote:

There is a table say T1 where in data is inserted in T1 through database link from other database. A Trigger on T1 table inserts data in another table T2.

Is it possible to have another insert trigger on table T2 which inserts data in another table T3.

Is there any constraint in defining trigger on table T2 ?

Technically, no.  But this is very suggestive of a poorly thought out design.  What is the relationship of the three tables, and what business purpose is achieved by these cascading triggers?

KayK

but don't forget  https://www.oracle.com/technetwork/testcontent/o58asktom-101055.html

"Triggers should be the exception, not the rule. They should be used only when you cannot do something any other way."

Mark D Powell

bootstrap, we have a process running on a factory server that inserts a row into a materials server table with an insert row trigger which then inserts into another table with an insert row trigger until six such triggers fire.  The last trigger inserts a row back to the source database.  Control is returned to the caller at which point the program reads the return row.  This process has worked without issue since version 7.x.

- -

Basic rule - trigger code should only act upon another table and when target tables have triggers the logic should never refer back to a prior tables in the stream.  Don't use additional triggers where the first trigger or calling process could just perform multiple DML operations itself.

- -

HTH -- Mark D Powell --

unknown-7404

Is it possible to have another insert trigger on table T2 which inserts data in another table T3.

What happened when you tried it?

Is there any constraint in defining trigger on table T2 ?

What happened when you tried it?

The BEST, and often fastest, way to learn is: TRY IT AND SEE!

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 11 2018
Added on Aug 14 2018
5 comments
168 views