I have this piece of code:
BEGIN
DECLARE @NewLine CHAR(2)
SET @NewLine = CHAR(13)+CHAR(10)
END
When I run it in phpmyadmin, I get this error:
#1064 - 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 'DECLARE @NewLine CHAR(2) SET @NewLine = CHAR(13) + CHAR(10) END' at line 2
I used about 2 hours on Google, without any luck. As far as I can tell, it should be the right syntax.
Someone please help
Flow statements like
IF,WHENand so on are only allowed in stored procedures or function in MySQL.BEGINandENDare delimiters of such statements.Put that code in a procedure and it should work.
Edit
Example procedure