Hi Manuel,

Thank you very much for your message.

In the generated SQL, there's a double whitespace, which seems to indicate
that the name of your constraint was simply empty (""). I wonder why that
is. Are the names registered correctly in the generated Keys.java class?
Can you share the constraint definition here?

Thanks,
Lukas

2017-11-26 23:30 GMT+01:00 Manuel Rossetti <[email protected]>:

> I believe that there is a problem with how the DDL statements are being
> constructed.  I would like to know if anyone else sees this as a problem.
>
> DSLContext create = DSL.using(getConnection(), SQLDialect.DERBY);
>
> Queries queries = create.ddl(getUserSchema());
>
> The "ALTER" queries do not have their constraints named. In the exception
> below, the name of the constraint is expected but the keyword "foreign" was
> encountered.  In the original creation script for the database all
> constraints were named but the name 'EdgeArc' was not captured by the
> create.ddl() statement.
>
> ALTER TABLE Arc ADD CONSTRAINT EdgeArc FOREIGN KEY (Edge) REFERENCES Edge
> (ID);
>
> SQLException when executing alter table "APP"."ARC" add constraint
> foreign key ("EDGE") references "EDGE" ("ID")
> java.sql.SQLSyntaxErrorException: Syntax error: Encountered "foreign" at
> line 1, column 41.
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
> Source)
>     at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown
> Source)
>     at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown
> Source)
>     at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
> Source)
>     at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown
> Source)
>     at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown
> Source)
>     at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
>     at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
>     at dbtools.dbutil.EmbeddedDerbyDatabase.executeCommand(
> EmbeddedDerbyDatabase.java:680)
>     at dbtools.dbutil.EmbeddedDerbyDatabase.executeCommands(
> EmbeddedDerbyDatabase.java:710)
>     at dbtools.dbutil.EmbeddedDerbyDatabase.duplicate(
> EmbeddedDerbyDatabase.java:210)
>     at dbtools.dbutil.EmbeddedDerbyDatabase.testWrting(
> EmbeddedDerbyDatabase.java:910)
>     at dbtools.dbutil.EmbeddedDerbyDatabase.main(
> EmbeddedDerbyDatabase.java:882)
> Caused by: ERROR 42X01: Syntax error: Encountered "foreign" at line 1,
> column 41.
>     at org.apache.derby.iapi.error.StandardException.newException(Unknown
> Source)
>     at org.apache.derby.iapi.error.StandardException.newException(Unknown
> Source)
>     at org.apache.derby.impl.sql.compile.ParserImpl.
> parseStatementOrSearchCondition(Unknown Source)
>     at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown
> Source)
>     at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown
> Source)
>     at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
>     at org.apache.derby.impl.sql.conn.GenericLanguageConnectionConte
> xt.prepareInternalStatement(Unknown Source)
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to