Home  >  Article  >  Database  >  How to turn off oracle triggers

How to turn off oracle triggers

青灯夜游
青灯夜游Original
2022-04-18 17:34:076765browse

Methods to close triggers: 1. Use the "ALTER TRIGGER trigger name DISABLE;" statement to close the trigger with the specified name; 2. Use the "ALTER TABLE table name DISABLE ALL TRIGGERS;" statement to Closes all triggers in the specified data table.

How to turn off oracle triggers

The operating environment of this tutorial: Windows 7 system, Oracle 11g version, Dell G3 computer.

The definition of a trigger means that when a certain condition is established, the statement defined in the trigger will be automatically executed.

Therefore, triggers do not need to be called manually and cannot be called. The triggering conditions of the trigger are actually set when it is defined.

How to turn off oracle triggers

When a trigger is created in Oracle, you may need to disable (turn off) the trigger. Then you can use the ALTER TRIGGER statement to do this.

There are two methods:

1. Close the specified trigger

ALTER TRIGGER trigger_name DISABLE;

Parameters

  • trigger_name - The name of the trigger to be disabled.

Example:

ALTER TRIGGER orders_before_insert DISABLE;

The trigger named orders_before_insert can be turned off.

2. Close all triggers in the specified table

ALTER TABLE table_name DISABLE ALL TRIGGERS;

Parameters

  • table_name - the table of triggers to be disabled name.

Example:

ALTER TABLE orders DISABLE ALL TRIGGERS;

All triggers on the table named orders.

Expand knowledge: enable oracle triggers

1. Enable specified triggers on the table

ALTER TRIGGER trigger_name ENABLE;

2. Enable all triggers on the table

ALTER TABLE table_name ENABLE ALL TRIGGERS;

Recommended tutorial: "Oracle Tutorial"

The above is the detailed content of How to turn off oracle triggers. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn