Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2002
    Location
    Antwerp, Belgium
    Posts
    227

    Unanswered: Trigger firing and not firing

    I have a trigger on a table that just updates a last_modified_date and this works fine on our production server. Now I have to update some data and I do not want the trigger to fire. I cannot disable or drop the trigger because the productions systems needs the trigger. Anyone an idea of how to solve this problem?
    Johan

  2. #2
    Join Date
    Feb 2004
    Posts
    492
    I don't think there's an easy way (if any) to bypass a trigger. It's advantage of being so close on the source makes it less handy in your case. Perhaps you could tell us more about what you're after and let us in a little on the table structure, we might come up with another idea.
    Last edited by Kaiowas; 08-27-04 at 04:56.

  3. #3
    Join Date
    Dec 2002
    Location
    Antwerp, Belgium
    Posts
    227
    Well, it's just a table containing customer info (name, address, ...). The call-center uses a web application to update this info. Everytime an update is performed, the last_modified date is updated through a trigger (which fires after insert and update). Every day a report is generated that contains the records updated on the previous day.
    I have now some info that I want to update, but the modification_date should be yesterday, but this is impossible because of the trigger. I cannot disable the trigger, as the call-center is using the database as well.
    Johan

  4. #4
    Join Date
    Aug 2004
    Posts
    15
    Hi Jora,

    You could upload the data into a temporary table from a spreadsheet, (the same structure as the table you want to update) and then use an SQL script to perform the update. Although you would still have to disable the trigger, it would update the records in seconds and could be arranged with your call centre people or set up as a DTS to run at a certain time.

    nomis (simonl)

  5. #5
    Join Date
    Feb 2004
    Posts
    492
    I don't have a really good idea on this but perhaps it's possible to temporarily change the existing trigger to check for the system_user. If it's you, then don't update.
    EDIT: As nomis suggests, if you can disable the trigger temporarily and the users agree, go for that (is it just me or is dbforums have real difficulty processing edit's ?).
    Last edited by Kaiowas; 08-27-04 at 06:00.

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The last three days or so, dbforumns has had chronic problems processing anything at all. I hope they get the problems ironed out soon.

    -PatP

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by Kaiowas
    (it just me or is dbforums have real difficulty processing edit's ?).
    Is it just me, or does mySQL just Suck?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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