CDbCommand failed to execute the SQL statement:

Hello,
in Step 5:
CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘AND attribute_id = 79 AND store_id = 0 LIMIT 1’ at line 1. The SQL statement executed was: SELECT * FROM `catalog_product_entity_datetime` `t` WHERE entity_id = AND attribute_id = 79 AND store_id = 0 LIMIT 1
I become this Error -- in the SQL Statement missing entity_id value.
What can i do?
Give it a way to Find the entrys in m1 databases and repair this or give it a another way
Robert
 
Sorry for my Bad English
 

11 answers

Profile photo of Mall Staff 184060.00 $tone December 20, 2018
Public

Hi there,

LIMIT 1’ at line 1. The SQL statement executed was: SELECT * FROM `catalog_product_entity_datetime` `t` WHERE entity_id = AND attribute_id = 79 AND store_id = 0 LIMIT 1

It seem your M1 database has some bad records in table catalog_product_super_link
Let’s try with steps below:
+ Download the PHP file at Here
+ And upload replace to the file at path: pub/ub-tool/protected/controllers/Step5Controller.php
+ Once done, continue with data migration in the step #5
And tell me know how it goes.
Regards,
Mall.

#1
Profile photo of ubdev Staff 98550.00 $tone December 21, 2018
Public

Hi Robert, 
Glad that it helps. 
We wish you and your family a Happy Christmas too. 
Meanwhile, in case you missed, we’re offering a special Xmas Sale at present. Please take a look at our other Magento 2 extensions (like UB Mega Menu, UB One Step Checkout …) to see if they are a good fit for your project. It gives you a big 25% saving for those extensions. The offer is available within today only. 
Regards,
Ubertheme team

#3
Profile photo of Bhavesh Jain 20.00 $tone September 4, 2019
Public

Hello,
in Step 5: i got below error..
 
CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘AND entity_id = 2976 LIMIT 1’ at line 1. The SQL statement executed was: SELECT * FROM `catalog_product_entity_int` `t` WHERE attribute_id = 145 AND value = AND entity_id = 2976 LIMIT 1
 
How can i fix issue ?
 

#4
Profile photo of ubdev Staff 98550.00 $tone September 4, 2019
Public

Hi Bhavesh Jain, 
 
We wonder if you have another paid profile at Ubertheme? We could not keep track of the purchase associated with your profile. 
 
If you’re using our Lite version on Github, it’s pity that we no longer maintain that version. We have another Lite version at Ubertheme, however it’s outdated as well. 
 
We’re sorry for this additional question, since our technical support requires active subscription though. 
 
Regards,
Ubertheme team

#5
Profile photo of safepakindustrial 290.00 $tone May 15, 2020
Public

Hi 
I have got this error in step5 : product migration : 

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘AND entity_id = 644 LIMIT 1’ at line 1

#6
Profile photo of cjfox 60.00 $tone August 26, 2020
Public

We’ve encountered the same problem after the most recent update (3.2.4) and also at step 5 -- Migrate Products (doing a delta migration)

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND attribute_id = 79 AND store_id = 0 LIMIT 1' at line 1

 
Is the php file from above still ok for version 3.2.4 ?
 
Thanks in advance, 
 
CJ
 
 

#8
Profile photo of Mall Staff 184060.00 $tone August 27, 2020
Public

Hi there,

Is the php file from above still ok for version 3.2.4 ?

No, that is the tweak code for bad data case of your M1 database only.

In Pro v3.2.4, you can handle for that case following these steps:

+ Open the PHP file at pub/ub-tool/protected/controllers/Step5Controller.php
and find the code lines:

$associatedProductId2 = (!$keepOriginalId) 
? UBMigrate::getM2EntityId(5, 'catalog_product_entity', $associatedProductId1)
: $associatedProductId1;

and replace it with:

$associatedProductId2 = (!$keepOriginalId) 
? UBMigrate::getM2EntityId(5, 'catalog_product_entity', $associatedProductId1)
: $associatedProductId1;
if (empty($associatedProductId2)) {
continue;
}

+ Once done you can continue with the data migration in step #5.

Regards,
Mall.

#9
Profile photo of ubdev Staff 98550.00 $tone August 28, 2020
Public

Hi there, 
We’re glad that it helped. Please continue with the process at your end. If you have any new questions, please get back to us here.
PS. Since our team is off at the weekend, our apology for a certain delay in response if you reach out to us during this time. 
Regards,
Ubertheme team

#11

Please login or Register to Submit Answer

Written By

Comments