Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7603071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:34:31+00:00 2026-05-30T23:34:31+00:00

How to achieve creating a trigger that ONLY updates if exist but NEVER inserts

  • 0

How to achieve creating a trigger that ONLY updates if exist but NEVER inserts in mysql.

Thanks in advance.

Edit: I had not known that using update statement just update if exist, and does not throw any error if not exist. Thanks to @juergend

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:34:33+00:00Added an answer on May 30, 2026 at 11:34 pm

    You can specify when a trigger gets fired: after update for instance.
    When it got fired then you can do whatever you want, for instance update an other table.

    Generally it works like that:

    delimiter //
    CREATE TRIGGER upd_trigger_name after UPDATE ON your_updated_table
       FOR EACH ROW
       BEGIN
            update other_table set col1 = a_value where id = other_value
       END;
    //
    delimiter ;
    

    MySQL keywords:

    update -> updates a record if found
    insert -> inserts a new recods
    replace -> updates if record found, inserts if not
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Many people said that one can achieve higher performance by creating read-only and write-only
I'm creating an iPhone app with UITabBarController. What I want to achieve is that
When creating web pages how do we achieve a consistent font size across browsers.
How can I achieve the following in oracle without creating a stored procedure? Data
I regularly achieve 100% coverage of libraries using TDD, but not always, and there
I am creating a string that I would like to pass to the bcp
I'm creating a stored procedure in SQL server and want to achieve the following:
What I am trying to achieve is, creating 2 threads sharing a common static
I am creating a UIBarButtonItem with a custom view in order to achieve a
I'm creating an undo-redo mechanism. To achieve this, I'm using Serialization. Recording the current

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.