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

How to turn off oracle triggers

青灯夜游
Release: 2022-05-23 20:47:30
Original
6831 people have browsed it

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;
Copy after login

Parameters

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

Example:

ALTER TRIGGER orders_before_insert DISABLE;
Copy after login

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;
Copy after login

Parameters

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

Example:

ALTER TABLE orders DISABLE ALL TRIGGERS;
Copy after login

All triggers on the table named orders.

Expand knowledge: enable oracle triggers

1. Enable specified triggers on the table

ALTER TRIGGER trigger_name ENABLE;
Copy after login

2. Enable all triggers on the table

ALTER TABLE table_name ENABLE ALL TRIGGERS;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template