SQLSTATE [23000]:完整性约束违例:1062密钥'IDX_STOCK_PRODUCT'的重复条目'1922-1' [英] SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1922-1' for key 'IDX_STOCK_PRODUCT'

查看:3719
本文介绍了SQLSTATE [23000]:完整性约束违例:1062密钥'IDX_STOCK_PRODUCT'的重复条目'1922-1'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建产品时,在检索一段时间后的最后一步,Magento给出以下错误:

While creating product, at the last step after retrieving for a time, Magento gives following error-:


SQLSTATE [23000]完整性约束违反:1062密钥'IDX_STOCK_PRODUCT'的重复条目'1922-1'

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1922-1' for key 'IDX_STOCK_PRODUCT'

我所做的是通过捕获产品ID ,我把它放在自定义表中。我已经连接到Magento数据库外部。

What I am doing is, by capturing product id, I am putting it's entry in custom table. I have connected to Magento database externally.

令人惊讶的是,数据插入在Magento的基表和也在自定义表,但为什么它会给我这个错误后产品保存...?

Surprisingly data is inserted in both Magento's base table & also in Custom table but why it is giving me that error after product saving...?

我清除缓存,浏览器cookie。
也删除/ var / cache,/ var / session。
仍然给出错误。
任何人都可以建议一个解决方案?

I cleared cache, browser cookies. Also remove /var/cache, /var/session. still giving error. Can anybody suggest a solution?

推荐答案

消息意味着你正在做另一个插入与相同的组合列是IDX_STOCK_PRODUCT的一部分,其接缝定义为UNIQUE。如果是这样,它不允许输入两次相同的组合(似乎它包括两个字段)。

the message means you are doing another insert with the same combination of columns that are part of the IDX_STOCK_PRODUCT, which seams to be defined as UNIQUE. If it is so, it doesn't allow to enter same combination (it seems like it consists of two fields) twice.

如果要插入记录,请确保选择全新的记录ID,或者记录ID和其他列的组合是唯一的。

If you are inserting records, make sure you are picking brand new record id or that the combination of record id and the other column is unique.

没有详细的表结构和代码,我们几乎不能猜到出错了什么。

Without detailed table structure and your code, we can hardly guess whats going wrong.

这篇关于SQLSTATE [23000]:完整性约束违例:1062密钥'IDX_STOCK_PRODUCT'的重复条目'1922-1'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆