Are triggers evil?

Hi,
A friend who works directly with Oracle told me everything must be done in order to try to avoid using triggers, but I couldn't understand why.
I'm not an Oracle (or any other database) expert, but I can understand that a trigger is a block of code that is executed for every insert, update or delete (I know you can say when to run it when you create it), so you have to be cautious not to run things too complicated or to "heavy" in order to not make the whole database slow. But, again, I think you need to be cautious with what your triggers are doing, but you don't need to avoid using them.
Is there anything I am missing?
Thanks in advance,
João Toledo

Hi,
Triggers have been/are being used in an inappropriate way very often, causing unexpected side-effects.
Many examples regarding why they've been used the wrong way have been explained by Thomas Kyte.
You can find articles and explanations on his site:
http://asktom.oracle.com
(do f.i. a search on "i hate triggers" ;) )
and on his blog:
http://tkyte.blogspot.com/2006/09/classic-example-of-why-i-despise.html
More regarding this subject can simply be googled, like:
http://rwijk.blogspot.com/2007/09/database-triggers-are-evil.html
A link showing the opposite is possible
http://thehelsinkideclaration.blogspot.com/2009/04/helsinki-code-layers-in-dbms.html
edit
Actually it goes for everything, not only triggers:
When applied inappropriatly or without realizing possible consequences, evil can (Murphy says "ultimatly *will*") happen.
It goes for triggers, for hints, for EAV, for a WHEN OTHERS then NULL etc...
Edited by: hoek on Nov 8, 2009 2:17 PM

Similar Messages

  • Need to find from where email are triggering

    Hi  All,
    I got a one request to find from where emails are triggering , user simply said it is from
    SCCM SQL Server and i tried to find in all SCCM ms sql server databases using
    syscomments and ROUTINE_DEFINITION , but i am unbale to find , actually i  want to delete these email id's , please can some one shed some light on this
    Thanks
    Prakash GR

    Hey normaly we use in operator for send mail.
    but i don't find table name that include email address, but you can find and make a filter (look this link).
    http://www.rickygao.com/create-customized-queries-to-get-what-we-need-in-sccm/
    Tzuri Ben Ezra | My Certifications:
    CompTIA A+ ,Microsoft MCP, MCTS, MCSA, MCITP |
    FaceBook: Tzuri FaceBook | vCard:
    Tzuri vCard | 
    Microsoft ID:
    Microsoft Transcript 
     |

  • 2 event-based mediators (in 2 separate composites) are triggered instead of

    Hi,
    I followed steps in http://docs.oracle.com/cd/E21764_01/integration.1111/e10224/bp_hwfmodel.htm#BABDBAJJ to create an SOA composite with event based mediator to be executed when a task is assigned to users. I created two separate composites (each one has an event mediator) but at runtime we noticed that whenever we execute a composite, both mediators in both composites are triggered !!

    I have the same problem. It would be great to see a solution. This is what I am trying to do:
    My xml document:
    <document>
    <person>
    <name>Jasmina</name>
    </person>
    <person>
    <name>Tajib</name>
    </person>
    <person>
    <name>Serif</name>
    </person>
    </document>
    Statement:
    select extract(doc, '/document/person/name/text()').getStringVal() as Names
    from xml_test
    Returns:
    NAMES
    JasminaTajibSerif
    I would like to get:
    NAMES
    Jasmina
    Tajib
    Serif

  • Why "full scans are not evil, indexes are not good"

    in this article inside asktom page
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:9422487749968
    tell about "full scans are not evil, indexes are not good"
    someone tell me why for this select mentioned index are not good?

    ...and if you read next post, nothing is black or white, it is all shades of grey .
    This is not because your query will use index that it would be faster, and the example which Tom gave is really explicit :
    With index usage 60127 consistent gets, and without index usage 92 consistent gets
    Nicolas.
    Message was edited by:
    N. Gasparotto

  • SMTP mail are triggering

    Hai, i configured SMTP on SP2010 and now im not using it but some of my friends are using the server and mails are triggered on my email, how could i stop this.
    NOTE: i cant access the SP2010 server.

    The email address that is used in the "From" field is completely disconnected from your user account. It is a text property that can be set to literally anything in the world. There is nothing that you can do as a user without changing that text property
    in Central Administration or changing your email address.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Email being sent multiple times when actions are triggered after creating an incident. Anyone has a resolution?

    Email being sent multiple times (3 times) when actions are triggered after creating an incident.
    Below is the snip of "Scheduled Actions" of the created Incident.

    Hi Ritesh
    Email is triggered based upon conditions and you set
    on closer look it is 3 different email on three 3 different requirement for e.g
    email triggered to reporter on new status
    email trigerred to processor on Proposed solution and New status
    Therefore, check the start condition for above 2 email actions and refer below blog
    Sending E-Mail from Support Message
    Thanks
    Prakhar

  • How actually MRA(management reporting area) triggers

    Hi
    How actually MRA(management reporting area) triggers?
    Any financial setting required?
    regards
    madahavan

    Hi Satish,
    You can try remodelling the cube with a new characteristic which is a flag\another version which will store the load date or something on the similar lines. This will let you report your DP data based on your load date.
    Hope this helps...
    Godhuli

  • Overriding the messages that are triggered in the function module

    Hi all,
    Can anybody knows the way to override the messages that is triggered in the Function module.
    Right now we are using a standard function module "SD_CONDITION_VALIDITY_PERIODS" to get validity period of a pricing condition. What happened is we have a missing pricing condition from the master so its checking the table T681 and giving the error. We want to override this condition. If anybody knows a way how we can implement this please let me know.
    Thanks in advance.
    Ved Nayak.

    Did you try going to the message app and clicking on the person name then go to the top and click the load earlier messages button. 

  • MIRO : bsx and KDM values are triggered and values are credit

    Dear Experts ,
           Good Morning to all ,
    IN MIRO , The transaction Event keys BSX and KDM is trigger.
    BSX for INVENTORY ACCESSORIES and  KDM for Exchange Fluctuations\
    But what happened is these two values are coming credit  one value is 3,612.88 -
    and another KDM value is 811.37 -
    Why BSX and KDM trigger credit .
    Please give  what are the Reasons .
    and why these two triggered in MIRO
    Thank u friends

    Hi,
    But why the values are credited in MIRO . These two values posted to credit
    what Rajesh given is correct and it will hit in MIRO only because after MIGO ,MIRo come in piture and it will adjust in MIRO
    Regards
    Kailas Ugale

  • How to find what are triggers are present in the database?

    Hi All
    Can any one tell me how to find what all triggers present in the database.
    Thanks in Advance

    Hi All
    Can any one tell me how to find what all triggers
    present in the database.
    Thanks in AdvanceYou should visit Pythia, the Oracle of Delphi, near Thermopile in Greece. She might be able to give you an answer. Pythia was an early leader in executive decision support systems and is not to be confused with the Oracle Corp. of Redmond, CA. Pythia also has a group of helpful colleagues in Toronto. Rumor is that they're also making predictions by inhaling laurel vapors. SQL, as you know, stands for "Said Quixotically on Laurel".

  • Slideshow elements are triggering next page in menu going nuts any ideas anyone

    slideshow heavy site is driving me nuts. Every element in slide show is triggering next page in top menu. Don't know what to do, deadline looming. any thoughts

    Hi,
    Kindly share the link to the site.
    Also, in the slideshow, select that particular image that is triggering the link, and check if you have any hyperlinks applied to it.
    Hope it helps,
    Sonam

  • [10g] entity validation are triggered twice and more?

    hello,
    i have a problem with validation method in an entity.
    in the ordre:
    1- i have created a methode validation "validationA" on the attribute "A"
    in my jspx, i change his value from 1 to 2
    3a- if my method (data = 1) return true, no problem.
    3b- if my method (data = 1) return false, she is call another time with the old value (data = 2)
    in my application where i have more than one view linked with this entity, my validationA method is triggered a lot.
    what can do to just check validation once? thanks
    Edited by: user10494597 on 20 nov. 2008 05:00

    Clicking the back button, doesn't clear the second entity and therefore it will still fail the validation.
    The user shouldn't click the back button, instead you should supply a "Cancel" button in the second page that will then clear the information that was entered in that screen and will navigate to the first form.

  • Shared memory area & triggering "client" actions

    Hi all,
    I'm playing around with shared objects, and I would like to accomplish one thing:
    I have a shared memory and a "client" class which uses it.
    When one of the instances of this client class calls a specific method of the shared memory root class, another instance of the client class should receive a message from the root class. This other instance would be running under a different user.
    Since no events are allowed for shared memory area root classes, event handling on the side of the client class is not possible. I even tried to store references to instances of the client class in the shared memory but this would not work either (surprise! surprise! - CX_SHM_EXTERNAL_REFERENCE
    So apart from periodically querying the root class from the client, is there really no way how to initialize the SHMA->client communication from the shared memory area side ?
    thanks,
    Stanislav Mikulas

    If your clients keep the read connection to the shared memory, is there a way to follow this connection back to the clients?
    But even if so, how could you trigger an event at the client?
    Actually, I think there is no solution besides polling the shared memory objects for changes periodically.

  • Midi Audio Cuts out when Playback tracks are triggered.

    Hi,
    I am having an issue where if I open Mainstage 2 and begin playing a Midi Sequence through a 3rd party Plug-in, the audio cuts out from the plug-in when I trigger my group of Playback tracks for the first time and only restarts when a new note is played. This is particularly a problem because the sound is arpegiated and continuous. 9 out of 10 times if I do it again right afterwards it will be fine without any issues at all. There was a time during rehearsal when it absolutely would not work, but I think a restart fixed it. CPU usage and memory usage do not seem to be the problem.
    So my question is, is it normal for it to do that on the first time? Is there any reason why it would not absolutely work that time during rehearsal. And lastly, is there anyway to make it just work every time!
    I have tried reading up on this, and from what I understand, putting each playback track on a separate patch might help. My issue with that is I have already designed a layout that fits everything on one screen in one patch. I don't want to be switching screens during a song to adjust levels for the playback tracks. I have One Vocal, One Midi Synth, 8 playback tracks, and 3 Aux strips.
    I am new to mainstage and might not completely understand how to make a set work with patches, but from what I understand if I put the playback tracks on different patches I can't control everything from one screen.
    Any thoughts, insights, or advice is greatly appreciated.

    Logic has that issue at times as well- where the first notes of a midi passage may not play. I believe the timing is such that the note starts are actually slightly before the first beat. Check your starting notes to make sure that they are really starting on the first beat and not slightly before.

  • Buttons are triggering page swipe

    I'm creating a DPS app for younger readers. parents are meant to operate it with them, but kids would interact with it. On the last round of testing multiple times the kids would trigger a page swipe while tyring to touch buttons (the buttons control MSO's). Is there a fix or work around to this?  
    thanks in advance

    Yes, while trying to hit any buttons they are swiping to the next or previous page accidentally. It isnt sometimes, it's more often than not.
    has anyone else developed content for kids with DPS and run into the same problem?  I know many times people have requested the feature to diable the page swipe, but until that is an available feature I can't think of a way to disable the swipe and have any buttons.

Maybe you are looking for

  • Iphone 6 to Kenwood in dash TV

    Ok, so I'm guessing with the swap to the lightning port video out to a car's head unit got a little screwed up some how.  I use to run netflix fine off of my 4s to my Kenwood, and there are no special fix cables that are supported by my head unit sin

  • Final Cut Pro4.5 and Leopard

    I bought an iMacG5 2.8Intel Core 2 Duo, 2.8GH, with installed OS Leopard. As I startet the installation of Final Cut Pro 4.5 (first with fire wire cable from my old iMac (OS Tiger) it appeared a notice saying " Fault of configuration for this softwar

  • Requested delivery date is emtpy

    We use business process creating quotation (AG) on CRM and sending its to R/3 system (SD). We try to create quotation in CRM system. Its quotation without problem go to R/3. We fill requested delivery date (REQ_DLV_DATE) in CRM system in quote - and

  • TS4009 How do I get a refund for downgrading my iCloud storage?

    How do I get a refund for downgrading my iCloud storage?

  • UrlEncode a stream or a Document

    Hi, I am trying to POST an xml document as form data. So, I build a org.w3c.dom.Document and want to post it. The problem is that I have to send it as conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded") Now, I could of course