开发者

Problem with autocommit in ANT SQL task

I have an SQL script and want to apply it witn ANT task. This script clears out schema, creates new tables and views.

The ANT defined task as follows:

<sql driver="com.mysql.jdbc.Driver"
        url="jdbc:mysql://host:3306/smth"
        userid="smth"
        password="smth"
        expandProperties="false"
        autocommit="true"             
        src="all.sql"
         >
</sql>

When this task launches, it shows in log that tables are cleared and created. But when it tries to create first view, it fails with:

Failed to execute:  CREATE VIEW component... AS SELECT component_raw.id 开发者_Python百科AS
MySQLSyntaxErrorException: Table 'component_raw' doesn't exist

I have no idea why it fails here. Running this all.sql from MySQL query browser gives no errors. When I launched ANT with -v option, I didn't see any "COMMIT" messages..

Please, help to resolve the problem.


I had completely the same issue, it turned out that I had comments in my sql files started with #. After replacing # for *-- * everything works fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜