Trigger can use in stored procedure and how with simple example?
Printable View
Trigger can use in stored procedure and how with simple example?
You can not Call trigger Explicitly....
Triggers can't be called explicitely ,they are raised automatically when the underlying event occurs.
Infact you can call a procedures in a trigger body. The procedure is called when the trigger fires upon the specified event.
HI
you can call any SP by using following code.
exec <sp_name> <parameter>
By using this code you can make use of any SP in a trigger,
hi
triggers r called implicitly. if u understand the concept of triggers, u'll not raise ths question. v use triggers to impose som businness rules wch v cannot mention in any database as constrains. triggers r raised if any sql st trying to violate those business rule. simple ex cld be "no updates / inserts on holidays and non-business hrs" so v write a trigger tht if a day is sunday or predefined holiday thn no inserts / updates. if some one try to update of sunday then this trigger raised automatically by the ora server. and updation is not possible.
[email]deviji2000@gmail.com[/email]
[QUOTE=deviji2000;19276]hi
triggers r called implicitly. [/QUOTE]
Triggers can't be called implicitely. They are raised.
hi,
Trigger are called automatically when any manuplation is done on the given table.
[QUOTE=mahesh9920;18536]Trigger can use in stored procedure and how with simple example?[/QUOTE]
Triggers cannot be called directly. Instead they are fired automatically when you perform an insert/update or delete on a table that has triggers. Therefore, you cannot call a trigger in a stored procedure. You can perform an insert / update or delete that will force a trigger to fire. As to the second part of your question, you can absolutely execute stored procedures in the source code of a trigger