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.