@CreateSchema cannot execute SQL statements with multiple lines
j-arturo opened this issue · comments
Hi there,
I have a file that I want to use with @CreateSchema, the file has statements like this:
CREATE TABLE Estado
(
ID INTEGER NOT NULL,
nombre VARCHAR(50) NOT NULL,
PRIMARY KEY (ID)
) ;
However, I got this exception:
org.jboss.arquillian.persistence.dbunit.exception.DBUnitDataSetHandlingException: Unable to execute line: CREATE TABLE Estado
As you can see, there is a problem parsing the statement.
I think the SQL_DELIMITER used in org.jboss.arquillian.persistence.core.data.script.ScriptExecutor class causes the problem:
private static final String SQL_DELIMITER = "(;)|(;(\r)?\n)|((\r)?(\n))";
If I modify the statement to fit in a single line, it works, but is awkward to read and edit the file when the statements are large, for example, when tables have a lot of columns.
CREATE TABLE Estado(ID INTEGER NOT NULL, nombre VARCHAR(50) NOT NULL, PRIMARY KEY (ID)) ;
Can you help me out? Thanks!
Please try latest build from master branch if possible. This is already fixed and will be shipped with the next release.
@bartoszmajsak
Same problem. The last tag is 6 months old. When are you planning to release the next one?
Great work here btw, congratz.
Hi,
fix for this problem is in master for a while already. I think I should
release new version by the end of this month.
Cheers
On Feb 24, 2013 2:07 AM, "Fagner Martins" notifications@github.com wrote:
Same problem. The last tag is 6 months old. When are you planning to
release the next one?Great work here btw, congratz.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-14001396.
@bartoszmajsak
I am waiting to be available on maven central.
I will ping you back asap.
On Feb 24, 2013 6:04 PM, "Fagner Martins" notifications@github.com wrote:
@bartoszmajsak https://github.com/bartoszmajsak
I am waiting to be available on maven central.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-14011610.
Related JIRA issue https://issues.jboss.org/browse/ARQ-1300
In case you have missed - Alpha6 is out. :)
Thanks man, great work. Now I can finnaly ident my SQLs ;)
Very important feature that is ;)