Triggers in oracle

You are currently browsing the articles from Techno Oracle matching the category Triggers in oracle.

Dropping Triggers in Oracle

Triggers may be dropped via the drop trigger command. In order to drop a trigger, you must either own the trigger or have the DROP ANY TRIGGER system privilege. Syntax: DROP TRIGGER trigger_name; Example: CREATE OR REPLACE TRIGGER EMP_MONDAY BEFORE INSERT OR UPDATE OR DELETE ON EMP BEGIN IF RTRIM(UPPER(TO_CHAR(SYSDATE,’DAY’)))=’MONDAY’ THEN RAISE_APPLICATION_ERROR (-20022,’NO OPERARTION CAN [...]

Written by admin on August 20th, 2010 with no comments.
Read more articles on Oracle PL/SQL and Triggers in oracle.

Enabling and Disabling Triggers

When a trigger is created it is automatically enabled and is triggered whenever the triggering command and the execution command is true.An enabled trigger executes the trigger body if the triggering statement is issued. To disable the execution use the ALTER TRIGGER command with the DISABLE clause. A disable trigger does not execute the trigger [...]

Written by admin on August 20th, 2010 with no comments.
Read more articles on Oracle PL/SQL and Triggers in oracle.

Error Handling in Triggers

The Oracle engine provides a procedure named raise_appliation_error that allows programmers to issue user-defined error messages. Syntax: RAISE_APPLICATION_ERROR (error_number, message); Here: error_number It is a negative integer in the range-20000 to –20999 Message It is a character string up to 2048 bytes in length This procedure terminates procedure execution, rolls back any effects of the [...]

Written by admin on August 20th, 2010 with no comments.
Read more articles on Oracle PL/SQL and Triggers in oracle.

Types of Triggers

A trigger’s type is defined by the type of triggering transaction and by the level at which the trigger is executed. Oracle has the following types of triggers depending on the different applications: Row Level Triggers Statement Level Triggers Before Triggers After Triggers Here is a brief description about above triggers: Row Level Triggers Row [...]

Written by admin on August 20th, 2010 with no comments.
Read more articles on Oracle PL/SQL and Triggers in oracle.

Triggers in Oracle PL/SQL

A database trigger is a stored procedure that is fired when an INSERT,UPDATE, or DELETE statements is issued against the associate table.The name trigger is appropriate, as these are triggered (fired) whenever the above-mentioned commands are executed. A trigger defines an action the database should take when some database related event occurs. A trigger can [...]

Written by admin on August 19th, 2010 with no comments.
Read more articles on Triggers in oracle.