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 8454221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:58:05+00:00 2026-06-10T11:58:05+00:00

I am currently running the following SQL statement on my MySQL database: INSERT INTO

  • 0

I am currently running the following SQL statement on my MySQL database:

INSERT INTO `Table` (`Col1`, `Col2`, `Col3`) VALUES ('a','b','c')
ON DUPLICATE KEY UPDATE `Col1`=`Col1`, `Col2`=`Col2`, `Col3`=`Col3`

However, everytime I do run it, I get the following error: #1205 - Lock wait timeout exceeded; try restarting transaction. It’s pretty horrible, because I don’t know what exactly went wrong. My intention is to update all the values of the existing row (with the exception of id, which is the table’s primary key).

If you do have any idea, please let me know!

EDIT: More info… the id is an auto-incremented field. There is also another UNIQUE column (let’s call it IdentityNo, and so what I’d like the statement to do is to: 1. insert if there is no conflict in IdentityNo, and 2. update that existing row if there is a conflict (without changing the id).

  • 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-06-10T11:58:07+00:00Added an answer on June 10, 2026 at 11:58 am

    If you want to refer to the values of the columns in the insert section of the above statement, you need to use values(column_name).
    You must use something like

    INSERT INTO
    Table (Col1, Col2, Col3) VALUES ('a','b','c')
    ON DUPLICATE KEY UPDATE Col1=values(Col1), Col2=values(Col2), Col3=values(Col3)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running ASP.NET connecting to a SQL Server 2005 database. Currently all my
I am retrieving the following sql statement from a table and then using bind
I'm currently running the following query: SELECT * from people WHERE id = 4;
I have the following problem: I have a form in site/banen (currently local running
Currently I do the to following clear all processes running on port lsof -i
I am currently running into an issue trying to create delegates from MethodInfo .
I'm currently running into trouble configuring MAMP 2 to use SSL with multiple virtual
I'm currently running some SQL which uses an IN expression to match against multiple
I am currently running a PHP script that queries the database and then sends
I have a small Android app and currently I am firing a sql statement

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.