Hi to all i’am a new user of liquibase have a problem with “formatted sql” for generate a stored procedure in Mysql (5.6):
i have this “changeLog.xml”
<databaseChangeLog
xmlns=“http://www.liquibase.org/xml/ns/dbchangelog”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd">
whit this “test.sql”
----------------------------------------------------------------------------------------------
–liquibase formatted sql
–changeset test:201
delimiter #
DROP PROCEDURE IF EXISTS sayHelloWorld;
create procedure sayHelloWorld()
BEGIN
SELECT ‘Hello World From The Database!’;
END; #
delimiter ;
–rollback DROP PROCEDURE IF EXISTS sayHelloWorld;
–changeset test:202
delimiter #
DROP PROCEDURE IF EXISTS sayHelloWorld;
create procedure sayHelloWorld()
BEGIN
SELECT ‘Hello World From a MySql Database!’;
END; #
delimiter ;
-----------------------------------------------------------------------------------------------------------
i have this error:
Liquibase update Failed: Error executing SQL delimiter #
DROP PROCEDURE IF EXISTS sayHelloWorld: You have an error in your SQL syntax; ch
eck the manual that corresponds to your MySQL server version for the right synta
x to use near 'delimiter #
DROP PROCEDURE IF EXISTS sayHelloWorld’ at line 1
my log is
--------------------------------------------------------------------------------------------------------------
SEVERE 25/06/13 12.27:liquibase: Error executing SQL delimiter #
DROP PROCEDURE IF EXISTS sayHelloWorld: 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 #
DROP PROCEDURE IF EXISTS sayHelloWorld’ at line 1
liquibase.exception.MigrationFailedException: Migration failed for change set src/test.sql::201::test:
Reason: liquibase.exception.DatabaseException: Error executing SQL delimiter #
DROP PROCEDURE IF EXISTS sayHelloWorld: 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 #
DROP PROCEDURE IF EXISTS sayHelloWorld’ at line 1:
Caused By: Error executing SQL delimiter #
DROP PROCEDURE IF EXISTS sayHelloWorld: 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 #
DROP PROCEDURE IF EXISTS sayHelloWorld’ at line 1:
Caused By: 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 #
DROP PROCEDURE IF EXISTS sayHelloWorld’ at line 1
… 9 more
I use the script in the workbench and i have no problem(i tried to change the script with remove the word delimiter but this not solve the issue).There is some one that can help me thanks por for the patience.