Entradas

Mostrando entradas de junio, 2008

What is stored procedure?

A stored procedure is a schema object. It is a group of SQL and PL/SQL statements. It is created in a user's schema A stored procedure can be used to implement business logic or as a security mechanism, but it is not executed automatically. executed interactively by using an Oracle tool, such as SQL*PLUS, or by calling it explicitly through a SQL statement by calling it in other procedures or triggers. A stored procedure provides better performance because it does not require created and compiled. Three types of parameters can be passed in a stored procedure: IN OUT INOUT

What is trigger?

What is trigger? Trigger is a kind of stored procedure that is executed implicitly when an UPDATE, INSERT, or DELETE statement is can be fired or executed, either before or after the triggering event. A trigger has three parts: A triggering event or statement A trigger restriction A trigger action A triggering event can be a SQL statement, a database event, or a user event. It includes: DML statements like INSERT, UPDATE, and DELETE on a table or view. DDL statements like CREATE, ALTER, and DROP on a schema object. Database operations like LOGON, LOGOFF, SERVERERROR, STARTUP, and SHUTDOWN. A trigger restriction specifies a logical expression. A trigger fires only when this logical expression is TRUE. A trigger action is a procedure that executes when the triggering event is issued and the trigger restriction evaluates Note: Important points regarding triggers: The STARTUP trigger can only be an AFTER event trigger. The SHUTDOWN trigger can only be a BEFO