mysql1_dart
mysql1_dart copied to clipboard
Semicolon
Semicolon
I have noticed using semicolon in the sql fails the it. Now it happens again
SELECT v.entity_id INTO @id FROM catalog_product_entity_varchar v JOIN catalog_product_entity p ON v.entity_id = p.entity_id WHERE v.attribute_id = '283' AND v.value = '889501092529' LIMIT 1;
SELECT v.value INTO @ean FROM catalog_product_entity_varchar v WHERE v.entity_id = @id AND v.attribute_id = '283' LIMIT 1;
(SELECT g.value INTO @image_front FROM catalog_product_entity_media_gallery g, catalog_product_entity_media_gallery_value gv WHERE g.entity_id IN (SELECT r.parent_id FROM catalog_product_relation r WHERE r.child_id = @id) AND g.value_id = gv.`value_id` AND (gv.position = '1') ORDER BY gv.position ASC) LIMIT 1;
(SELECT g.value INTO @image_back FROM catalog_product_entity_media_gallery g, catalog_product_entity_media_gallery_value gv WHERE g.entity_id IN (SELECT r.parent_id FROM catalog_product_relation r WHERE r.child_id = @id) AND g.value_id = gv.`value_id` AND (gv.position = '2') ORDER BY gv.position ASC) LIMIT 1;
SELECT @id, @ean, @image_front, @image_back
The following don't work in the plugin. It works to run in phpmyadmin. Also running the SELECT calls separately works with the plugin.
I found some mysql information that says I need to give the statement separator differently in the client https://www.mysqltutorial.org/mysql-stored-procedure/mysql-delimiter/
It did not help. Setting:
DELIMITER //
To make it work in flutter, while it works to run it in phpMyAdmin
The error says: Error 1064 (42000) which should be related to DELIMITER according to this SO thread: https://stackoverflow.com/questions/6998705/error-1064-42000-in-mysql