Inventory 和 SAP 的 Magento 唯一键错误
我正在尝试使用 SAP 作为后端来配置 Magento。
我已经使用 PHP 脚本连接到 SAP 系统。我还向其中添加了数据。现在我正在尝试更新添加的数据,但遇到错误。
致命错误:未捕获异常“PDOException”,消息为“SQLSTATE[23000]:违反完整性约束:1062 中键“UNQ_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID”的重复条目“298-1” D:\xampp\htdocs\magento\lib\Zend\Db\Statement\Pdo.php:228
堆栈跟踪:
#0 D:\xampp\htdocs\magento\lib\Zend\Db\Statement\Pdo.php(228): PDOStatement->execute(Array)
#1 D:\xampp\htdocs\magento\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 D:\xampp\htdocs\magento\lib\Zend\Db\Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 D:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 D:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)< /p>
#5 D:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)< /p>
#6 D:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Abstract.php(574): Varien_Db_Adapter_Pdo_ 在 D:\xampp\htdocs\magento\lib\Zend\Db\Statement\Pdo 中。 php第234行
请帮我解决这个问题。
I'm trying to configure Magento using SAP as a back end.
I have connected to the SAP system using PHP script. And also I have added data to it. Now I'm trying to update the added data, but I'm stuck on an error.
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '298-1' for key 'UNQ_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID'' in D:\xampp\htdocs\magento\lib\Zend\Db\Statement\Pdo.php:228
Stack trace:
#0 D:\xampp\htdocs\magento\lib\Zend\Db\Statement\Pdo.php(228): PDOStatement->execute(Array)
#1 D:\xampp\htdocs\magento\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 D:\xampp\htdocs\magento\lib\Zend\Db\Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 D:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 D:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#5 D:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#6 D:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Abstract.php(574): Varien_Db_Adapter_Pdo_ in D:\xampp\htdocs\magento\lib\Zend\Db\Statement\Pdo.php on line 234
Kindly help me solve this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试从管理员中的“系统”>“索引管理”执行完整的重新索引。如果失败,请截断
cataloginventory_stock_status_idx
表并重新索引,然后再次运行脚本。Try performing a full reindex from System>Index Management in the admin. If that fails, truncate the
cataloginventory_stock_status_idx
table and reindex, then run your script again.如果安装了“Market Ready 德国”扩展程序,您需要确保您的浏览器正在发送引荐来源网址 - 否则会出现上述错误。 (没有任何关于推荐人的提示......)
If one has installed the extension "Market Ready Germany", you need to make sure your browser is sending a referrer – otherwise the above error will occur. (With no hint on the referrer…)