What is difference between triggers and stored procedures.
And advantages of SP over triggers ?
Answer Posted / jaya
1) Stored procedures can accept parameters and can return values. Triggers can neither accept parameters nor return values.
2) A Trigger is dependent on a table and the application has no control to not fire a trigger when not needed. On the other hand, a stored procedure can be called as needed.
3) Procedure runs only when one call them manually whereas a trigger runs when there is any activity(insert,update,delete) on table on which the trigger is written.
4) Firing of a stored procedure can be controlled whereas on the other hand trigger will get fired whenever any modification takes place on the table.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
How to display the records between two range in Oracle SQL Plus?
What is nosql example?
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
What is dynamic query?
What is the difference between count 1 and count (*) in a sql query?
Explain the significance of the & and && operators in pl sql.
What will you get by the cursor attribute sql%notfound?
what is the difference between join and union? : Sql dba
What is data control language?
Can we rollback after truncate?
What is an exception in pl/sql?
Mention what does plv msg allows you to do?
Is sql dba a good career? : SQL DBA
Which kind of parameters cannot have a default value in pl sql?
how to use 'mysql' to run sql statements? : Sql dba