-
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
-
you are selecting where owner - 'EDWDM' but then using alter trigger siebel.
different schemas
-
I have change the owner and tried again. It still does not loop through all the records and disable.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|