I have some more complex mysql queries. Could I arrange in the same mysql node this?
Like this content in a mysql node:
SET @var_parent_data = "Select...";
PREPARE query FROM @var_parent_data;
EXECUTE query;
/* And more... */
I have some more complex mysql queries. Could I arrange in the same mysql node this?
Like this content in a mysql node:
SET @var_parent_data = "Select...";
PREPARE query FROM @var_parent_data;
EXECUTE query;
/* And more... */
If you have not already tried it I can give it a bash in the morning.
I just try at first. I am not very good in this structure.
It failed.
I tested with @ and @@ for variables.
Could we build node to use variables like this?
It 's very important to structure a complex query. Now I can not read queries which is so much complex, and need to structure it to variables.
Did you get an error message?
Yes I have error.
It seems not supported for variables.
Query for test
SET @name = "project_details.name";
SELECT @name
FROM project_details WHERE project_details.status = "Done";
Error
ERROR: 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 'SELECT @name FROM project_details WHERE project_details.stat' at line 2
I 'm using MYSQL 8
So I tested some structured variable from this
https://dev.mysql.com/doc/refman/8.0/en/user-variables.html