Hello,

Thanks for reporting.

I can confirm that this issue appears when using the jOOQ model API along
with plain SQL table and field names (as opposed to the generated objects).
The reason is that internally, Result.into(Table) is used, but that Table
reference doesn't have any column information.

I've registered an issue for this, which will be fixed for all currently
maintained jOOQ versions:
https://github.com/jOOQ/jOOQ/issues/3682

Thanks again,
Lukas

2014-10-13 22:27 GMT+02:00 <[email protected]>:

> I'm trying to programmatically generate an insert query and retrieve the
> db generated ID (using serial8 and PostgreSQL 9.3).
>
> I do the following on a table called "accounts" that just contains an
> "account_id" and a "name":
>
>  InsertQuery<Record> insert = create.insertQuery(DSL.tableByName("org2",
> "accounts"));
>  insert.addValue(DSL.fieldByName("name"), "acct4");
>  insert.setReturning(DSL.fieldByName("account_id"));
>  int inserted = insert.execute();
>  Record r = insert.getReturnedRecord();
>
> After execution, the new record is inserted correctly in the database, and
> the value of inserted == 1.
>
> However r.size() is 0, and I can't get the "account_id" from it (I try
> r.getValue("account_id", Java.lang.Long))
>
> Any help would be appreciated.
>
> Thanks.
>
> --
> 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