Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Could not drop triggers with special characters

lraotankalaNov 10 2020

Hi,
I have to drop 800+ triggers from one of the schema. However, I could not drop them because of special characters in it. Here is an example how the triggers exist with special characters( pattern remains same across all the triggers)
Ex: /1LT/00019335DEL
/1LT/00019335INS

Here is the simple script developed to drop them.
{code}

DECLARE

CURSOR get_check_trg
IS SELECT TRIGGER_NAME FROM USER_TRIGGERS WHERE TRIGGER_NAME LIKE '/%/%';

BEGIN

for l in get_check_trg
loop

EXECUTE IMMEDIATE 'DROP trigger '|| l.TRIGGER_NAME ;
dbms_output.put_line(l.TRIGGER_NAME);
end loop;

END;
/

{code}

Regards,
Lak

Comments
Post Details
Added on Nov 10 2020
9 comments
449 views