1

I'm getting following error:

Caused by: org.teiid.jdbc.TeiidSQLException: TEIID31100 Parsing error: Encountered "insert into \"form\".\"form_insertdefault_1\" [*]default[*] values"

I need to fill table with only default values and manual insert works fine. INSERT INTO form.form_insertdefault_1 DEFAULT VALUES; I use postgresql database and JOOQ (InsertQuery.setDefaultValues()) for database-mapping.

1 Answers1

0

TEIID isn't a supported dialect in jOOQ, and I don't think that the PostgreSQL dialect will get you very far, given how specific a lot of PostgreSQL stuff is. I'd try the H2 or HSQLDB dialects, instead.

In any case, you'll have to do a lot of emulations, like this one, yourself, if you want to run jOOQ on an unsupported dialect. Instead of DEFAULT VALUES, which only very few RDBMS support natively, you can maybe list DEFAULT (using DSL.default_()) expressions for each columns. This is what jOOQ would do for most dialects, anyway. E.g.

insert into form.form_insertdefault_1 (col1, col2, col3)
values (default, default, default);

Or even, just list a single column:

insert into form.form_insertdefault_1 (col1)
values (default);

Or, if DEFAULT is also not supported, pick an arbitrary nullable column that does not have a DEFAULT expression attached to its definition, and insert NULL, there:

insert into form.form_insertdefault_1 (nullable_non_defaulted_column)
values (null);
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
  • Hi Lukas, thank you for your thorough and prompt answer. I never expected such a quick response! DEFAULT is not supported either, so I went with inserting NULLs. – Martin Maťko Mar 01 '21 at 14:17