Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semicolon #136

Open
Lelelo1 opened this issue Jun 23, 2022 · 3 comments
Open

Semicolon #136

Lelelo1 opened this issue Jun 23, 2022 · 3 comments

Comments

@Lelelo1
Copy link

Lelelo1 commented Jun 23, 2022

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.

@Lelelo1
Copy link
Author

Lelelo1 commented Jun 23, 2022

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/

@Lelelo1 Lelelo1 closed this as completed Jun 23, 2022
@Lelelo1
Copy link
Author

Lelelo1 commented Jun 23, 2022

It did not help. Setting:

DELIMITER //

To make it work in flutter, while it works to run it in phpMyAdmin

@Lelelo1
Copy link
Author

Lelelo1 commented Jun 30, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant