DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Disable Trigger - Procedure

  1. #1
    Join Date
    Jun 2001
    Posts
    45

    Disable Trigger - Procedure

    I have a procedure as below to disable triggers. When I execute only the first trigger is disabled. Rest of the triggers are not disabled. But when executing the same code as pl/sql by replacing the "PROCEDURE disable_trigger AS" to declare and run a PL/SQL script it disables all triggers.

    PROCEDURE disable_trigger
    AS
    CURSOR trigger_cur
    IS
    SELECT *
    FROM all_triggers
    WHERE owner = 'EDWDM';

    build_sql VARCHAR2 (500);
    BEGIN
    FOR tc IN trigger_cur
    LOOP
    build_sql :=
    'ALTER TRIGGER SIEBEL.' || tc.trigger_name || ' DISABLE';

    EXECUTE IMMEDIATE (build_sql);
    END LOOP;
    END;

    Thank you for the help

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    you are selecting where owner - 'EDWDM' but then using alter trigger siebel.

    different schemas

  3. #3
    Join Date
    Jun 2001
    Posts
    45
    I have change the owner and tried again. It still does not loop through all the records and disable.

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Spool out "build_sql" after execute immediate and see what is happening.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width