Oracle triggers 6-manage triggers

Source: Internet
Author: User

Oracle trigger 6-manage trigger Oracle trigger 5-Instead of trigger http://www.bkjia.com/database/201304/203344.html 1. disable, enable, and delete trigger alter trigger trigger_name disable; alter trigger trigger_name enable; drop trigger trigger_name; example: disable or enable the create or replace PROCEDURE settrig (tab IN VARCHAR2, sch in varchar default null, action IN VARCHAR2) ISl_action VARCHAR2 (10): = UPPER (action ); l_other_action VARCHAR2 (10): = 'Disabled' ; BEGINIF l_action = 'disable' THENl_other_action: = 'enabled'; end if; FOR rec IN (SELECT trigger_nameFROM user_triggersWHERE table_owner = UPPER (NVL (sch, USER )) AND table_name = tabAND status = l_other_action) loopexecute immediate 'alter trigger' | rec. trigger_name | ''| l_action; end loop; END; 2. create or replace TRIGGER just_testingAFTER insert on abc DISABLEBEGINNULL; END; -- note that re-compilation is disabled Will activate the trigger. 3. Data Dictionary view related to the TRIGGER DBA_TRIGGERSALL_TRIGGERSUSER_TRIGGERS4. Check the validity of the trigger SQL> SELECT object_name, object_type, statusFROM user_objectsWHERE object_name = 'invalid _ TRIGGER ';

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.