Difference between Triggers and Stored Procedure
Answer Posted / bibhudatta panda
Triggers
Triggers provide a way of executing PL/SQL code on the occurrence of specific database events. For example, you can maintain an audit log by setting triggers to fire when insert or update operations are carried out on a table. The insert and update triggers add an entry to an audit table whenever the table is altered.
The actions that Informix Dynamic Server triggers perform are constrained to multiple insert, update, delete, and execute procedure clauses; whereas, Oracle allows triggers to execute arbitrary PL/SQL code. Oracle triggers are similar to stored procedures in that they can contain declarative, execution, and exception handling code blocks.
Additionally, Oracle enables triggers to be invoked by many events other than table insert, update and delete operations. However, there are restrictions.
Stored Procedures
Stored procedures provide a powerful way to code application logic that can be stored on the server. Informix Dynamic Server and Oracle both use stored procedures. Oracle also uses an additional type of subprogram called a function.
The language used to code stored procedures is a database-specific procedural extension of SQL. In Oracle it is PL/SQL and in Informix Dynamic Server it is Informix Dynamic Server Stored Procedure Language (SPL). These languages differ considerably. However, most of the individual SQL statements and the procedural constructs, such as if-then-else, are similar in both languages.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to encrypt data between dialogs?
Why it is recommended to avoid referencing a floating point column in the where clause?
What is the difference between locking and multi-versioning?
What are sql server procedures?
Give an example of why you would want to denormalize a database
Is profiler the only tool that has the ability to audit and identify ddl events? : sql server security
what is the main function of a query parameter?
What is the command to change the recovery model?
Define inner join? Explain with an example?
Can you import Microsoft Excel data to SSRS?
What are the triggers in sql?
What are the elements of dbms?
What are the differences between substr and charindex in sql server.
what are the new features introduced in sql server 2000? : Sql server database administration
What happens if the update subquery returns multiple rows in ms sql server?