DSLContext.alterTableIfExists() invalid SQL on MySQL

10 views
Skip to first unread message

Bert-Jan de Gier

unread,
Jun 16, 2022, 8:28:08 AM6/16/22
to jOOQ User Group
Hello,

Maybe I'm doing something wrong, but I've tried to rename my table in MySQL using jOOQ using DSLContext.alterTableIfExists(). The resulting query is:

alter table if exists `oldname` rename to `newname`

But my MySQL instance refuses this claiming it's invalid SQL. When I use DSLContext.alterTable() it does work correctly. Is this a bug in jOOQ or am I doing something wrong? Thanks for any insights you can give.

Best regards,
Bert-Jan de Gier

Lukas Eder

unread,
Jun 16, 2022, 8:48:27 AM6/16/22
to jOOQ User Group
The DSLContext.alterTableIfExists() does not support MySQL as per the documentation:

--
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 jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/f5e8f6d7-ee89-44a1-9e32-57af422e7e56n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages