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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:18:01+00:00 2026-06-08T19:18:01+00:00

I have a table CREATE TABLE IF NOT EXISTS `b_sale_order_props_value` ( `ID` int(11) NOT

  • 0

I have a table

CREATE TABLE IF NOT EXISTS `b_sale_order_props_value` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ORDER_ID` int(11) NOT NULL,
  `ORDER_PROPS_ID` int(11) DEFAULT NULL,
  `NAME` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `VALUE` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `CODE` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `IX_SOPV_ORD_PROP_UNI` (`ORDER_ID`,`ORDER_PROPS_ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1921 ;

I make a query

INSERT INTO `b_sale_order_props_value` 
    SET `ORDER_ID`=316, 
        `ORDER_PROPS_ID`=30, 
        `NAME`='ADDRES', 
        `VALUE`='Test addres' 
    ON DUPLICATE KEY UPDATE `NAME`='ADDRES',`VALUE`='Test addres';

returns an error

Duplicate entry '316-30' for key 'IX_SOPV_ORD_PROP_UNI'

How to fix this trouble?

  • 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-08T19:18:02+00:00Added an answer on June 8, 2026 at 7:18 pm

    Too big to post as a comment – your queries work here:

    mysql> use test;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql> CREATE TABLE IF NOT EXISTS `b_sale_order_props_value` (
        ->   `ID` int(11) NOT NULL AUTO_INCREMENT,
        ->   `ORDER_ID` int(11) NOT NULL,
        ->   `ORDER_PROPS_ID` int(11) DEFAULT NULL,
        ->   `NAME` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
        ->   `VALUE` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        ->   `CODE` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
        ->   PRIMARY KEY (`ID`),
        ->   UNIQUE KEY `IX_SOPV_ORD_PROP_UNI` (`ORDER_ID`,`ORDER_PROPS_ID`)
        -> ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1921 ;
    Query OK, 0 rows affected (0.11 sec)
    
    mysql> insert into b_sale_order_props_value (ORDER_ID, ORDER_PROPS_ID, NAME, VALUE, `CODE`) values (316, 30, 'replaceme', 'replaceme', 'replaceme');
    Query OK, 1 row affected (0.42 sec)
    
    mysql> INSERT INTO `b_sale_order_props_value`
        ->     SET `ORDER_ID`=316,
        ->         `ORDER_PROPS_ID`=30,
        ->         `NAME`='ADDRES',
        ->         `VALUE`='Test addres'
        ->     ON DUPLICATE KEY UPDATE `NAME`='ADDRES',`VALUE`='Test addres';
    Query OK, 2 rows affected (0.04 sec)
    
    mysql> select * from b_sale_order_props_value;
    +------+----------+----------------+--------+-------------+-----------+
    | ID   | ORDER_ID | ORDER_PROPS_ID | NAME   | VALUE       | CODE      |
    +------+----------+----------------+--------+-------------+-----------+
    | 1921 |      316 |             30 | ADDRES | Test addres | replaceme |
    +------+----------+----------------+--------+-------------+-----------+
    1 row in set (0.00 sec)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a code: CREATE TABLE IF NOT EXISTS Person ( name varchar(24) ...
I have a table: CREATE TABLE siteConfig ( settingName VARCHAR(64) NOT NULL, value VARCHAR(255),
I have this table: CREATE TABLE `test` ( `ID` int(11) NOT NULL auto_increment, `text`
I have this table: CREATE TABLE `point` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `siteid`
Table Structure CREATE TABLE IF NOT EXISTS `blogs` ( `id` int(11) NOT NULL auto_increment,
I have this table: CREATE TABLE IF NOT EXISTS `produtos` ( `id` int(11) NOT
I have the following table: CREATE TABLE IF NOT EXISTS `customer_list` ( `id` INT
I have this table CREATE TABLE IF NOT EXISTS `links` ( `link_id` int(20) NOT
I have one table: CREATE TABLE IF NOT EXISTS `test` ( `firstname` varchar(100) NOT
I have a table like create table adjacencies( relationId int not null primary key

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.