Input paramter--Trigger Starting String  _disable all triggers

I want a procedure where input parameter is trigger's starting letter and the function shoudl disable all triggers starting with that name
Please help me

Hey,
You can use this procedure:
create or replace procedure p_disable_all_trg_by_letter(p_letter in varchar2,
p_disable boolean,
p_table boolean) is
begin
If p_table Then
for i in (select trigger_name
from user_triggers
where table_name like upper(p_letter) || '%') loop
execute immediate 'alter trigger ' || i.trigger_name || case when p_disable then ' disable ' else ' enable ' end;
end loop;
Else
for i in (select trigger_name
from user_triggers
where trigger_name like upper(p_letter) || '%') loop
execute immediate 'alter trigger ' || i.trigger_name || case when p_disable then ' disable ' else ' enable ' end;
end loop;
End If;
end;
Note that this procedure takes 3 argument's:
a. the table or trigger name (could be one letter or more)
b. boolean flag - true will disable the triggers, false will enable them
c. boolean flag - true will search by the table name, false by the trigger name
Amiel.

Similar Messages

  • Need enable all triggers start eith 'EMP_'

    Hi ,
    i am looking for a single query to enable all of my triggeers start with trigger name'EMP_' insted of enable all triggers individually.any help??

    in pl/sql something like:
      begin
        for i in (select owner||'.'||trigger_name trg_name
                    from all_triggers where trigger_name like 'EMP_%' and status = 'DISABLED') loop
          execute immediate 'alter trigger '||i.trg_name ||' enable';
        end loop
      end;
    in sql spool the file then run the spool file.
      set verify off;
      set echo off;
      set fedback off;
      spool c:\sql\enabled_trigger.sql;
      select 'alter trigger '||owner||'.'||trigger_name||' enable;' from all_triggers
       where trigger_name like 'EMP_%' and status = 'DISABLED';
      spool off;
      set fedback on;
      set echo on;
      set verify on;

  • How to view text of all triggers?

    How to view text of all triggers?
    I tried,
    sqlplus "/ as sysdba"
    SQL> Select Description, Trigger_Body from all_triggers;
    I see only one trigger but there are more than 500 triggers.

    Perhaps you want to query DBA_TRIGGERS instead of ALL_TRIGGERS.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_4162.htm#sthref1922
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2107.htm#sthref1297

  • Recompilation of all triggers in a schema.

    Hi folks!
    I got a gotcha!
    I'd changed couple of table structures here and there in the schema and subsequently, quite understandably, all the triggers that are related to the afore-altered tables went into invalid status.
    It is taking a toll on me to again recompile each and every trigger in the schema.
    How do I recompile all the triggers in the entire schema with the help of a single statement?
    Your favour'll be deeply appreciated.
    Cheers, PCZ.

    I'd changed couple of table structures here and there
    in the schema and subsequently, quite understandably,
    all the triggers that are related to the
    afore-altered tables went into invalid status.
    It is taking a toll on me to again recompile each and
    every trigger in the schema.
    How do I recompile all the triggers in the entire
    schema with the help of a single statement?
    Your favour'll be deeply appreciated.
    Cheers, PCZ.I wana know why you need explicitly recompile all triggers when implicit recompilation exist there??
    SQL> CREATE OR REPLACE TRIGGER mytrigger BEFORE UPDATE ON emp FOR EACH ROW
      2  BEGIN
      3  IF :new.sal>100 THEN
      4    RAISE_APPLICATION_ERROR(-2001,'No valid update');
      5  END IF;
      6  END;
      7  .
    SQL> /
    Trigger created.
    SQL> SELECT object_name,status FROM all_objects WHERE object_type='TRIGGE
    OBJECT_NAME                    STATUS
    MYTRIGGER                      VALID
    SQL> ALTER TABLE emp ADD (a  NUMBER);
    Table altered.
    SQL> SELECT object_name,status FROM all_objects WHERE object_type='TRIGGE
    OBJECT_NAME                    STATUS
    MYTRIGGER                      INVALID
    SQL> UPDATE emp SET sal=200 WHERE deptno=20;
    UPDATE emp SET sal=200 WHERE deptno=20
    ERROR at line 1:
    ORA-21000: error number argument to raise_application_error of -2001 is out of range
    ORA-06512: at "SCOTT.MYTRIGGER", line 3
    ORA-04088: error during execution of trigger 'SCOTT.MYTRIGGER'
    SQL> SELECT object_name,status FROM all_objects WHERE object_type='TRIGGER';
    OBJECT_NAME                    STATUS
    MYTRIGGER                      VALIDKhurram

  • Program for find and replace a string in all the reports in a package

    Hello experts,
                        Is there any standard report or transaction provided by SAP which can be used to find a String in all the program in a package ? 
    As per my knowledge there is a program RPR_ABAP_SOURCE_SCAN which can search for a string in a package but this program doesnot support the replacement .
    Any clue in this regard will be helpful.
    Thanks
    Vivek

    Vevek, you are searching for something very very destructive.. do you realize that?
    its better if you could explain us the requirement, by the way for a automated change you need to have INSERT REPORT called inside some program, so start searching that line if you can get it
    else, write a piece of code for it..

  • Jonatan R. Aug 1, 2012 5:42 PM Hello, didnt really know hwere to post this guess it more belong under like "computers" generally,    but! For a while...        (-THE LONGER VERSION) : No whait!, let me start where it all began, 2009, a december (erhh.. ii

    Hello, didnt really know hwere to post this guess it more belong under like "computers" generally, 
    but! For a while... 
        (-THE LONGER VERSION) :
    No whait!, let me start where it all began, 2009, a december (erhh.. iii think? Hwatever!) litlle me hwere nearly Totally blank to the computer world. And suddenly it stood there on the table, a shining (it was shining back there) new "hp pavillion entertainment pc" with its smell of fresh plastic mixed hwith the strong smell from the cardboardbox, remember it as if it were yesterday
    ... Since then.... I have today a good solid pc knowing! (at more advance level cmd,bott menu, recovery, blah, blah... NERD!) here at the last awhile, ive prommised to make a lot! A lot of video projects!
    (okay 2, but some big ones!) avchd multilayer 2 hours!!!! 
    So the poor hp laptop -dual core i2 4gb ram, has been begged to it knees! And simply cant handle it of course! and it have just trough time benn loaded with lots of crap, and is extremly noisy, heat, slow, anoying = unusable!
    SO hwat i need is...
        (-THE SHORTER) :
    A computer setup that will EASILY! could handle stuff like that  (avchd, multilayer, 2 hours project) -and simmilar. A total power machine! But Im tired of windows! And ugly cheap looking design! The times have changed and i change with them!
    NOW I WANT APPLE!! 
    But but but... Hwat should i get????
    1. Im NOT a billionare!
    2. I repeat: NOT a billionare!
    3. I also need portability for every day use beyond the hardcore creative editing and use
    AT LAST:
     i saw in front of me this genius plan... With a macbook pro, a tuned one, with as much of ram,cpu,gpu, and everything else as it can posibble have
    -the perfect combination of transportabillity, everydayuse and total power!
    When it gets combine with,
    A cinemadisplay
    A extra keyboard
    And a extra magic mouse
    And this power macbook pro, with screen, mouse, and keyboard i've found a really good offer at.
    MY ACTUAL QUESTION.... :
    Now it is yours turn to please! be creative! Please! Hwat does all you genius heads! think and say?
    WILL A super tuned MACBBOK PRO COMBINED WITH ACCESSORIES, AT ALL, BE ABLE TO REPLACE A STRONG MAC PRO, OR AT LEAST BE MORE THAN ENOUGH FOR REALLY HEAVY STUFF? And if yes, HOW strong actually (ram,cpu,gpu...) will it need to have to be "more than enough"?
    If no, what would all of  you then suggest that is perfect in relation to everything?
    PLEASE ANSWER!!

    Jonatan R. wrote:
    WILL A super tuned MACBBOK PRO COMBINED WITH ACCESSORIES, AT ALL, BE ABLE TO REPLACE A STRONG MAC PRO,
    No,
    the MacPro is the muscle machine and not constrained by power or cooling limitations like the MacBoo Pro is.
    OR AT LEAST BE MORE THAN ENOUGH FOR REALLY HEAVY STUFF?
    If you press the MacBook Pro like a desktop machine, it will blow fans like a hurricane but will do the job eventually.
    The longer you blow fans on a laptop, the sooner it clogs up with crippling dust and shortens the life of the machine.
    You'll need the top end 15" or better, not the 13" as it has no dedicated graphics, only CPU graphics.
    Preferably if you just now getting into video, you should be considering Avid on a Windows 7 tower, it's because Apple has been ignoring the MacPro for hardware updates to improve it and it seems like they don't want to carry it anymore. Also the last Final Cut Pro version had Hollywood up in arms as Apple removed a lot of required abilities to make it more "consumer friendly" which upset the Pro market who likes control.
    Apple is focusing on the consumer computing market and getting away from the "Pro" market which needs the heavier hardware to handle video needs. They stopped selling the X-RAID and the X-Server, so Apple really isn't a "computer" company any longer.
    Sure you can use a MacBook Pro and a external monitor for doing home movies and such occasionally, but if your into serious production you need to consdier other options now.
    There is nothing wrong in getting a MacBook Air and a Windows 7 professional video tower too.

  • Firefox update failed, so I re-installed. Now firefox won't start up at all?

    ''locking as a duplicate of https://support.mozilla.org/en-US/questions/969557''
    So I ran firefox, and it was updating. While updating, firefox crashed for no apparent reason so I had to close it. Afterwards, every time I tried to start up firefox, it gave me the update failed error, followed by a crash less than a second later. I followed some instructions, uninstalling and re-installing firefox (without removing personal data), but now firefox won't start up at all!
    Now what?

    We're sorry to hear that your Firefox seems to be crashing when you open it. Please perform the following steps to give us a crash report ID that helps us find out more about the cause of the crash.
    #Press the following shortcut to get a Run window: [Windows] + [R]. This should bring up a window that contains a text field.
    #In that text field, enter %APPDATA% and press Enter. An explorer window should open.
    #From that explorer window, double-click on the ''Mozilla'' folder, then double-click on ''Firefox'' and then on ''Crash reports''. Double-click on ''submitted''.
    #Now, you should see a list of files that contain reports. Go to ''View'' > ''Arrange Icons by'' > ''Modified'' to get the most recent files at the top of the window.
    #Open the most recent 5 files with a text editor and copy the IDs.
    #Paste each ID with '''bp-''' into the reply window on the forums.
    Thanks in advance!
    You can find more information and troubleshooting steps in the [[Firefox crashes]] article.

  • My iPhone 5 suddenly started re-downloading all previously deleted emails from my POP accounts

    Yesterday, my iPhone 5 started re-downloading all previously deleted emails from my POP email accounts. I use the native Mail app and have three POP emails set up on my phone. The number of messages downloaded across all of them is over 1,000 so far and date back over several months. One of these is a Yahoo account, the others are work email accounts provided by two different hosting companies. I have not changed anything on any of these three accounts at the server/hosting level. I also run an IMAP account on my phone, which has not been affected, so this is obviously a POP-only issue. I started to delete the messages only to discover that older messages were downloaded in their place. There appears to be a cap of 250 messages downloaded at a time, but there's no way to change this in the phone's settings (this used to be a feature, but disappeared some time ago).
    I'm on iOS8.3 (upgraded a month ago with no affect on email). I have not changed any of my phone's email settings, so I don't understand why this has happened out of the blue. I have checked the phone's email settings and there doesn't seem to be a way to limit the number of messages downloaded.
    Does anyone know:
    a. why this has happened, and
    b. how I get it to stop?
    Thanks!

    Oh my gosh I had the EXACT same problem, and for ages I couldn't figure out how to fix it until today. Here's what I did:
    First I went onto my computer, opened itunes, and un-installed tumblr, vine and kik. These were the apps I was having problems with (it said I had them on my phone but, like you, they didn't show).
    Then I went to the itunes store, searched for each one, and it said I could update them so I did (just FYI: for tumblr a window popped up saying "please click ok to confirm you are 17 years or older", so I did that also)
    When I went back to my phone and tried installing them again (still on my computer), it worked!
    I hope this helps, because it was incredibly frustrating. Good luck!

  • How to find a string in all directories/folders

    Good Day,
    I need to search for a word through out all the directories .Is there any command that which I can type to search for a string in all the directories,folders and sub folders at one time.
    Thanks in advance.
    Regards,
    Gopi.CH
    Edited by: 915796 on 10-Jun-2012 19:18

    Use the find command if you are looking for a specific file or directory name. The following example will find only filenames (type f) that contain the word "sample", but exclude the results found in /usr and /u01:
    # find / -type f -name "*sample*" | egrep -v "/u01|/usr"
    /home/oracle/snippets/parse2.sample
    /home/oracle/snippets/parse3.sample
    /root/sample.bin.dc
    /root/sample2.bin
    /root/sample.bin
    /root/sample.des
    /root/sample.out
    /etc/gdm/PostLogin/Default.sample
    /proc/sys/kernel/perf_event_max_sample_rateUse the grep command to search for content. For example:
    # grep -r "Dude" /home
    /home/oracle/snippets/sched_stop_dist.sh:# Author   : Dude
    /home/oracle/snippets/healthcheck.sh:# Author:     Dude

  • When I try to transfer songs to my ipod touch or my friends ipod nano in which both have manually managed music, I get error 13019 "Ipod cannot be synced".  This problem started to occur all of a sudden. Any ideas other than the resyncing?

    When I try to transfer songs to my ipod touch or my friends ipod nano, I get error 13019 "Ipod cannot be synced".  Everything was working fine and transferring successfully and then this problem started to occur all of a sudden. My music is managed manually and always has. I looked online for a solution and they all involve resyncing the library and unchecking voice memos. Is there a way to resolve this issue without having to resync my music or reinstall itunes?

    Have you powered off and then back on the router?
    Have you done anything to the router recently like changed a setting?
    Have you tried:
    - Resetting the iPod. Nothing will be lost.
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Resetting network settings: Settings>GeneralReset>Reset Network SettingsTo me the error sounds like a network/router problem vice aan iPod problem.

  • How to find out if a string is all alphabets

    Hi,
    How can I find out if a string contains all alphabets? Please help. Thanks.

    Hi,
    How can I find out if a string contains all
    all alphabets? Please help. Thanks. I am not sure if there's easier way. But this code should do what you want:
    boolean bAlpha = true;
    for (int i=0; i<str.length; i++)
    if (!Character.isLetter(str.charAt(i))){
    bAlpha = false;
    break;
    //bAlpha is true if str contains only alphabets.

  • Hi, I need help my computer is not starting up at all, nothing happening when I press the button on/off. The battery charger is working as using it for another laptop. Not sure what to do. Anyone have any idea? many thanks

    Hi, I need help my computer is not starting up at all, nothing happening when I press the button on/off. The battery charger is working as using it for another laptop. Not sure what to do. Anyone have any idea? many thanks

    You could try a SMC reset:
    http://support.apple.com/kb/HT3964
    If no change, do what Allan advises.
    Caio.

  • HT2534 When setting up my apple I'd I get a verification email but there does not seen to be a link to click on there is a link that says "verify now" but it's not a link the only other thing on the page is a link to apple thats starts the process all ove

    When setting up my apple I'd I get a verification email but there does not seen to be a link to click on there is a link that says "verify now" but it's not a link the only other thing on the page is a link to apple thats starts the process all over again.does anyone have a solution for this problem?

    The idea to jumpstart by change was not the smartest one, but gives you an opportunity to use that "temporary" account as permanent. You do not have a choice cause obviously despite you thinking that old account is no more -it does exist on Apple servers. And if you are unwilling to share your [email protected] with friend, just create one extra [email protected] for your friend. One suggestion - do not use gmail.

  • HT201272 A lot of my songs, once put on the iCloud, will not download to my iPod.  They are on my iTunes, already downloaded, but will not appear in my library on my iPod.  Before I started using iCloud, all music in my iTunes library was on my iPod.

    A lot of my songs, once put on the iCloud, will not download to my iPod.  They are in my iTunes library, already downloaded, but will not appear in my library on my iPod.  There is no common thread for the origin of the songs--many were ripped from CD's, others purchased in the iTunes store.  Before I started using iCloud, all music in my iTunes library was on my iPod without any issues.

    - Are you saying that they are not listed in your Purchased section?
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    - Are they listed in your Puchases history when you log into your account on your computer?
    - Are they still available now for purchase? If not then you are out of luck
    If they are still available and listed in your Puchase History then contact iTunes
    http://www.apple.com/support/itunes/

  • Itunes Won't Start..at all.

    I've been through many of the bigger posts here looking for a solution ot my problem but sadly haven't found one.
    I had iTunes 4.9 and installed 5.0 ontop of it. When I went to start 5.0 it would not start. At all. I get a hourglass for about half a second and then nothing. No error message. No nothing. I don't run any firewall or antivirus currently. I've tried disabling the bonjour services. I've tried installing quicktime standalone and the bonjour services then installing itunes. I've made sure I have a current version of the dll. I'm not sure what else I am supposed to try. Wondering if I missed any posts that might help me.
    Thanks for your time.

    well here you have my story
    Whenever I use iTunes, it seems to only want to open upon the very first time after installation. It's very irritating - the only way I can get it to work again is to totally uninstall it (repair doesn't work), then reinstall it. Then it works - only for the first time again. Doh! :happy:
    Everytime I try to open it up, the hourglass/arrow combo cursor appears for about 2 seconds and then nothing happens. In task manager, the iTunes exe appears for that same amount of time and then disappears.
    After trying three clean XP installs and re-installing both quicktime and iTunes numerous times, I still can't figure out why it won't start! Has anyone else had this problem?

Maybe you are looking for

  • Depreciation run with special period

    We require 2 set of FS reports:- 1.) FS as at 14/12/2007 2.) FS as at 31/12/2007 We have use the following period to derive the the reports 1.) Period 12 (Transactions 1st - 14th Dec 2007) 2.) Period 14 ( Transactions 15th - 31st Dec 2007) Q1.)Should

  • Horizontal menu submenu display issue in IE9

    I inserted a Spry horizontal menu into a page in Dreamweaver CS5 then edited it to display the way I need it to look. It looks great in FF, Safari, Chrome and Opera. In IE9 the drop down submenu items have too much (vertical) space between them. This

  • Encore CS5 hangs when opening project

    I have read posts about this problem already and the solutions proposed so far seem to do with changing or erasing cache files, fiddling with Premiere Pro, etc.  Frankly, I don't understand any of that!!  Can someone suggest something more direct?  W

  • How can i download apps for a ipod second generation

    I have an ipod 2nd generation, i know i can't download the ios4 or 5, but i cant download any apps because i need to update but i can't. is there any way around this?

  • Distributed environment - 10gR2

    Hi. We are installing an application server environment on Sles9, 10g R2. Server A will contain Identity Management and MetaData Repository for OID. Server B will contain application server mid-tier with business intelligence and forms. Further, we h