#1064.You have an error in your SQL syntax;check manual that corresponds to MySQL server version for the right syntax to use near 'NULL' at line 1 -
i have following code. getting error like:
error code: 1064. have error in sql syntax; check manual corresponds mysql server version right syntax use near 'null' @ line 1
mysql code:
set session group_concat_max_len = 8192*50; set @sql = null; select group_concat(distinct concat( 'select id, "', c.column_name, '" word limesurvey.lime_survey_697389 ' ) separator ' union ' ) @sql information_schema.columns c c.table_name = 'limesurvey.lime_survey_697389' , c.column_name '697389%' order c.ordinal_position; set @sql = concat('select id, word (', @sql, ') x order id'); prepare stmt @sql; execute stmt; deallocate prepare stmt;
can here? new mysql.
you cannot define null value @sql. instead can try this:
set @sql = '';
edit:
you need execute above code inside stored program or function. mysql docs says:
mysql supports if, case, iterate, leave loop, while, , repeat constructs flow control within stored programs.
Comments
Post a Comment