distal-attribute
distal-attribute
distal-attribute
distal-attribute

Error while export 2

User, date Message
Written by sergtop
4 years ago
Category: General
55 posts since Mon, 23 Nov 09
when exporting routine create sql query seems to be incorrect

generated code is
[localhost] DELIMITER // CREATE DEFINER=`user`@`%` PROCEDURE `timespopulate`(IN `startdate` DATETIME, IN `num` INT) BEGIN DECLARE ctr INT DEFAULT 0; WHILE ctr < num DO BEGIN INSERT INTO dates (`date`) VALUES ( DATE_ADD( startdate, INTERVAL ctr day) ); SET ctr = ctr + 1; END; END WHILE; END// DELIMITER ;

/* [localhost] SQL 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 'DELIMITER // CREATE DEFINER=`user`@`%` PROCEDURE `timespopulate`(IN `startdate' at line 1 */
Written by ansgar
4 years ago
4793 posts since Fri, 07 Apr 06
Seems your target server (where you import the file) doesn't support the DELIMITER command. Which server versions (source + targert)?
Written by sergtop
4 years ago
55 posts since Mon, 23 Nov 09
source - 5.0.45
target - 5.0.45
Written by ansgar
4 years ago
4793 posts since Fri, 07 Apr 06
I see. Very special case here with the DELIMITER. That's only for cases in which HeidiSQL executes queries in another database or server. In other cases, these DELIMITER xyz clauses get parsed. Should get some workaround.
Written by ansgar
4 years ago
4793 posts since Fri, 07 Apr 06
Fixed
 

Please login to leave a reply, or register at first.