It is not SQLyog that sends this error messsage. It is MySQL that does!
There is no (My)SQL “DECLARE” statement.
However you can DECLARE inside (BEGIN .. END) of a Stored procedure or Function (or Trigger or Event etc).
an example:
Code:
DELIMITER $$
DROP FUNCTION IF EXISTS `test`.`qs`$$
CREATE FUNCTION `test`.`qs`() RETURNS varchar(50)
BEGIN
declare querystr varchar(50);
— more operations here
return querystr;
END$$
DELIMITER;
You can also use 'user variables' like
SET @querystr = 'something'.
(and the type of a user variable is not declared)