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

Error while export 2

sergtop posted 5 years ago in General
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 */
ansgar posted 5 years ago
Seems your target server (where you import the file) doesn't support the DELIMITER command. Which server versions (source + targert)?
sergtop posted 5 years ago
source - 5.0.45
target - 5.0.45
ansgar posted 5 years ago
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.
ansgar posted 5 years ago
Fixed

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