Declaring mysql variables inside heidisql query tab
I have declared a variable in heidisql tab like this
DECLARE total_count INT DEFAULT 0;
SET total_count = 10;
select total_count;
but i am getting this error
/ * SQL error (1064): you have an error in your SQL syntax; check the manual corresponding to your MySQL server version for the correct syntax to use next to 'DECLARE total_count INT DEFAULT 0' on line 1 // Affected lines: 0 Lines found: 0 Warnings: 0 Duration for 0 out of 3 queries: 0.000 sec. * /
Should I declare, set and use a variable as I did or should I wrap everything inside a stored procedure or function?
+3
user3286430
source
to share